NetworkParameters: Remove ID_PRODNET. Resolves issue 430.

This commit is contained in:
Mike Hearn 2013-07-22 18:12:36 +02:00
parent adea4f9479
commit 2acbd55d47
3 changed files with 8 additions and 3 deletions

View file

@ -52,8 +52,6 @@ public abstract class NetworkParameters implements Serializable {
*/
public static final byte[] SATOSHI_KEY = Hex.decode("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284");
/** The string returned by getId() for the main, production network where people trade things. */
public static final String ID_PRODNET = "org.bitcoin.production";
/** The string returned by getId() for the main, production network where people trade things. */
public static final String ID_MAINNET = "org.bitcoin.production";
/** The string returned by getId() for the testnet. */
@ -134,26 +132,31 @@ public abstract class NetworkParameters implements Serializable {
public static final BigInteger MAX_MONEY = new BigInteger("21000000", 10).multiply(COIN);
/** Alias for TestNet3Params.get(), use that instead. */
@Deprecated
public static NetworkParameters testNet() {
return TestNet3Params.get();
}
/** Alias for TestNet2Params.get(), use that instead. */
@Deprecated
public static NetworkParameters testNet2() {
return TestNet2Params.get();
}
/** Alias for TestNet3Params.get(), use that instead. */
@Deprecated
public static NetworkParameters testNet3() {
return TestNet3Params.get();
}
/** Alias for MainNetParams.get(), use that instead */
@Deprecated
public static NetworkParameters prodNet() {
return MainNetParams.get();
}
/** Returns a testnet params modified to allow any difficulty target. */
@Deprecated
public static NetworkParameters unitTests() {
return UnitTestParams.get();
}

View file

@ -1070,6 +1070,7 @@ public class Wallet implements Serializable, BlockChainListener, PeerFilterProvi
if (result == TransactionInput.ConnectionResult.ALREADY_SPENT) {
if (fromChain) {
// Double spend from chain: this will be handled later by checkForDoubleSpendAgainstPending.
log.warn("updateForSpends: saw double spend from chain, handling later.");
} else {
// We saw two pending transactions that double spend each other. We don't know which will win.
// This should not happen.
@ -1082,6 +1083,7 @@ public class Wallet implements Serializable, BlockChainListener, PeerFilterProvi
// The outputs are already marked as spent by the connect call above, so check if there are any more for
// us to use. Move if not.
Transaction connected = checkNotNull(input.getOutpoint().fromTx);
log.info(" marked {} as spent", input.getOutpoint());
maybeMovePool(connected, "prevtx");
}
}

View file

@ -39,7 +39,7 @@ public class MainNetParams extends NetworkParameters {
genesisBlock.setDifficultyTarget(0x1d00ffffL);
genesisBlock.setTime(1231006505L);
genesisBlock.setNonce(2083236893);
id = ID_PRODNET;
id = ID_MAINNET;
subsidyDecreaseBlockCount = 210000;
spendableCoinbaseDepth = 100;
String genesisHash = genesisBlock.getHashAsString();