3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 02:05:53 +00:00

Make the NetworkParameters.testNet() point to testNet3 and rename oldTestNet->testNet2(). Resolves issue 285.

This commit is contained in:
Mike Hearn 2013-01-30 17:56:57 +01:00
parent 7108751d3c
commit a62825bd8f
3 changed files with 12 additions and 9 deletions

View File

@ -176,7 +176,7 @@ public class NetworkParameters implements Serializable {
public final BigInteger MAX_MONEY = new BigInteger("21000000", 10).multiply(COIN); public final BigInteger MAX_MONEY = new BigInteger("21000000", 10).multiply(COIN);
/** Sets up the given Networkparemets with testnet3 values. */ /** Sets up the given Networkparemets with testnet3 values. */
private static NetworkParameters createTestNet(NetworkParameters n) { private static NetworkParameters createTestNet3(NetworkParameters n) {
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 // Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
n.proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL); n.proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
n.packetMagic = 0x0b110907; n.packetMagic = 0x0b110907;
@ -226,16 +226,19 @@ public class NetworkParameters implements Serializable {
return n; return n;
} }
/** The first test chain created by Gavin. Don't use this! */ /** Returns whatever the latest testNet parameters are. Use this rather than the versioned equivalents. */
public static NetworkParameters oldTestNet() { public static NetworkParameters testNet() {
return testNet3();
}
public static NetworkParameters testNet2() {
NetworkParameters n = new NetworkParameters(); NetworkParameters n = new NetworkParameters();
return createOldTestNet(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(); NetworkParameters n = new NetworkParameters();
return createTestNet(n); return createTestNet3(n);
} }
/** The primary BitCoin chain created by Satoshi. */ /** The primary BitCoin chain created by Satoshi. */
@ -277,7 +280,7 @@ public class NetworkParameters implements Serializable {
/** Returns a testnet params modified to allow any difficulty target. */ /** Returns a testnet params modified to allow any difficulty target. */
public static NetworkParameters unitTests() { public static NetworkParameters unitTests() {
NetworkParameters n = new NetworkParameters(); NetworkParameters n = new NetworkParameters();
n = createTestNet(n); n = createTestNet3(n);
n.proofOfWorkLimit = new BigInteger("00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16); n.proofOfWorkLimit = new BigInteger("00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16);
n.genesisBlock.setTime(System.currentTimeMillis() / 1000); n.genesisBlock.setTime(System.currentTimeMillis() / 1000);
n.genesisBlock.setDifficultyTarget(Block.EASIEST_DIFFICULTY_TARGET); n.genesisBlock.setDifficultyTarget(Block.EASIEST_DIFFICULTY_TARGET);

View File

@ -34,7 +34,7 @@ import static org.junit.Assert.*;
// Handling of chain splits/reorgs are in ChainSplitTests. // Handling of chain splits/reorgs are in ChainSplitTests.
public class BlockChainTest { public class BlockChainTest {
private static final NetworkParameters testNet = NetworkParameters.oldTestNet(); private static final NetworkParameters testNet = NetworkParameters.testNet2();
private BlockChain testNetChain; private BlockChain testNetChain;
private Wallet wallet; private Wallet wallet;

View File

@ -29,7 +29,7 @@ import java.util.Arrays;
import static org.junit.Assert.*; import static org.junit.Assert.*;
public class BlockTest { public class BlockTest {
static final NetworkParameters params = NetworkParameters.oldTestNet(); static final NetworkParameters params = NetworkParameters.testNet2();
public static final byte[] blockBytes; public static final byte[] blockBytes;