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

Give regtest mode its own ID so wallets don't get mixed up between regtest and testnet.

This commit is contained in:
Mike Hearn 2014-06-24 18:37:19 +02:00
parent 9680911bca
commit 32360fea8d
2 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,8 @@ public abstract class NetworkParameters implements Serializable {
public static final String ID_MAINNET = "org.bitcoin.production";
/** The string returned by getId() for the testnet. */
public static final String ID_TESTNET = "org.bitcoin.test";
/** The string returned by getId() for regtest mode. */
public static final String ID_REGTEST = "org.bitcoin.regtest";
/** Unit test network. */
public static final String ID_UNITTESTNET = "com.google.bitcoin.unittest";
@ -207,6 +209,8 @@ public abstract class NetworkParameters implements Serializable {
return TestNet3Params.get();
} else if (id.equals(ID_UNITTESTNET)) {
return UnitTestParams.get();
} else if (id.equals(ID_REGTEST)) {
return RegTestParams.get();
} else {
return null;
}

View File

@ -34,6 +34,7 @@ public class RegTestParams extends TestNet2Params {
maxTarget = MAX_TARGET;
subsidyDecreaseBlockCount = 150;
port = 18444;
id = ID_REGTEST;
}
@Override