mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 06:44:16 +00:00
Avoid confusing bugs by switching NetworkParameters.testNet() to be testnet3 not testnet2.
This commit is contained in:
parent
707e3a0989
commit
6504296b79
@ -176,7 +176,7 @@ public class NetworkParameters implements Serializable {
|
||||
public final BigInteger MAX_MONEY = new BigInteger("21000000", 10).multiply(COIN);
|
||||
|
||||
/** Sets up the given Networkparemets with testnet3 values. */
|
||||
private static NetworkParameters createTestNet3(NetworkParameters n) {
|
||||
private static NetworkParameters createTestNet(NetworkParameters n) {
|
||||
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
|
||||
n.proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
|
||||
n.packetMagic = 0x0b110907;
|
||||
@ -200,8 +200,8 @@ public class NetworkParameters implements Serializable {
|
||||
return n;
|
||||
}
|
||||
|
||||
/** Sets up the given NetworkParameters with testnet values. */
|
||||
private static NetworkParameters createTestNet(NetworkParameters n) {
|
||||
/** Sets up the given NetworkParameters with testnet2 values. Don't use! */
|
||||
private static NetworkParameters createOldTestNet(NetworkParameters n) {
|
||||
// Genesis hash is 0000000224b1593e3ff16a0e3b61285bbc393a39f78c8aa48c456142671f7110
|
||||
n.proofOfWorkLimit = Utils.decodeCompactBits(0x1d0fffffL);
|
||||
n.packetMagic = 0xfabfb5daL;
|
||||
@ -226,16 +226,16 @@ public class NetworkParameters implements Serializable {
|
||||
return n;
|
||||
}
|
||||
|
||||
/** The test chain created by Gavin. */
|
||||
public static NetworkParameters testNet() {
|
||||
/** The first test chain created by Gavin. Don't use this! */
|
||||
public static NetworkParameters oldTestNet() {
|
||||
NetworkParameters n = new NetworkParameters();
|
||||
return createTestNet(n);
|
||||
return createOldTestNet(n);
|
||||
}
|
||||
|
||||
/** The testnet3 chain created by Gavin, included in Bitcoin 0.7. */
|
||||
public static NetworkParameters testNet3() {
|
||||
public static NetworkParameters testNet() {
|
||||
NetworkParameters n = new NetworkParameters();
|
||||
return createTestNet3(n);
|
||||
return createTestNet(n);
|
||||
}
|
||||
|
||||
/** The primary BitCoin chain created by Satoshi. */
|
||||
|
@ -34,7 +34,7 @@ import static org.junit.Assert.*;
|
||||
// Handling of chain splits/reorgs are in ChainSplitTests.
|
||||
|
||||
public class BlockChainTest {
|
||||
private static final NetworkParameters testNet = NetworkParameters.testNet();
|
||||
private static final NetworkParameters testNet = NetworkParameters.oldTestNet();
|
||||
private BlockChain testNetChain;
|
||||
|
||||
private Wallet wallet;
|
||||
|
@ -29,7 +29,7 @@ import java.util.Arrays;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class BlockTest {
|
||||
static final NetworkParameters params = NetworkParameters.testNet();
|
||||
static final NetworkParameters params = NetworkParameters.oldTestNet();
|
||||
|
||||
public static final byte[] blockBytes;
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class ToyWallet {
|
||||
public ToyWallet(boolean testnet, boolean fullChain, String[] args) throws Exception {
|
||||
// Set up a Bitcoin connection + empty wallet. TODO: Simplify the setup for this use case.
|
||||
if (testnet) {
|
||||
params = NetworkParameters.testNet3();
|
||||
params = NetworkParameters.testNet();
|
||||
} else {
|
||||
params = NetworkParameters.prodNet();
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ public class WalletTool {
|
||||
discovery = new DnsDiscovery(params);
|
||||
break;
|
||||
case TEST:
|
||||
params = NetworkParameters.testNet3();
|
||||
params = NetworkParameters.testNet();
|
||||
chainFileName = new File("testnet.chain");
|
||||
discovery = new IrcDiscovery("#bitcoinTEST3");
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user