From 3aac4b00253fae41e1f3e55c3565a5d539579b9d Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Sat, 1 Nov 2014 15:22:35 +0100 Subject: [PATCH] Rewrite most references to prodnet to mainnet in the comments. Does not change any actual code. --- core/src/main/java/org/bitcoinj/core/Address.java | 8 ++++---- core/src/main/java/org/bitcoinj/core/Block.java | 2 +- .../main/java/org/bitcoinj/core/NetworkParameters.java | 4 ++-- core/src/main/java/org/bitcoinj/core/PeerAddress.java | 2 +- .../java/org/bitcoinj/net/discovery/IrcDiscovery.java | 6 +++--- .../main/java/org/bitcoinj/params/package-info.java | 2 +- .../org/bitcoinj/store/H2FullPrunedBlockStore.java | 10 +++++----- .../bitcoinj/store/PostgresFullPrunedBlockStore.java | 10 +++++----- .../test/java/org/bitcoinj/core/CoinbaseBlockTest.java | 2 +- core/src/wallet.proto | 2 +- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/Address.java b/core/src/main/java/org/bitcoinj/core/Address.java index 7c8a0cf1..3289569f 100644 --- a/core/src/main/java/org/bitcoinj/core/Address.java +++ b/core/src/main/java/org/bitcoinj/core/Address.java @@ -47,7 +47,7 @@ public class Address extends VersionedChecksummedBytes { /** * Construct an address from parameters, the address version, and the hash160 form. Example:

* - *

new Address(NetworkParameters.prodNet(), NetworkParameters.getAddressHeader(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));
+ *
new Address(MainNetParams.get(), NetworkParameters.getAddressHeader(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));
*/ public Address(NetworkParameters params, int version, byte[] hash160) throws WrongNetworkException { super(version, hash160); @@ -76,7 +76,7 @@ public class Address extends VersionedChecksummedBytes { /** * Construct an address from parameters and the hash160 form. Example:

* - *

new Address(NetworkParameters.prodNet(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));
+ *
new Address(MainNetParams.get(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));
*/ public Address(NetworkParameters params, byte[] hash160) { super(params.getAddressHeader(), hash160); @@ -87,12 +87,12 @@ public class Address extends VersionedChecksummedBytes { /** * Construct an address from parameters and the standard "human readable" form. Example:

* - *

new Address(NetworkParameters.prodNet(), "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL");

+ *

new Address(MainNetParams.get(), "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL");

* * @param params The expected NetworkParameters or null if you don't want validation. * @param address The textual form of the address, such as "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL" * @throws AddressFormatException if the given address doesn't parse or the checksum is invalid - * @throws WrongNetworkException if the given address is valid but for a different chain (eg testnet vs prodnet) + * @throws WrongNetworkException if the given address is valid but for a different chain (eg testnet vs mainnet) */ public Address(@Nullable NetworkParameters params, String address) throws AddressFormatException { super(address); diff --git a/core/src/main/java/org/bitcoinj/core/Block.java b/core/src/main/java/org/bitcoinj/core/Block.java index ef4a6b25..b7be3784 100644 --- a/core/src/main/java/org/bitcoinj/core/Block.java +++ b/core/src/main/java/org/bitcoinj/core/Block.java @@ -518,7 +518,7 @@ public class Block extends Message { /** * Returns the hash of the block (which for a valid, solved block should be below the target) in the form seen on - * the block explorer. If you call this on block 1 in the production chain + * the block explorer. If you call this on block 1 in the mainnet chain * you will get "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048". */ public String getHashAsString() { diff --git a/core/src/main/java/org/bitcoinj/core/NetworkParameters.java b/core/src/main/java/org/bitcoinj/core/NetworkParameters.java index 2efd3420..8de42166 100644 --- a/core/src/main/java/org/bitcoinj/core/NetworkParameters.java +++ b/core/src/main/java/org/bitcoinj/core/NetworkParameters.java @@ -263,7 +263,7 @@ public abstract class NetworkParameters implements Serializable { * block to be valid, it must be eventually possible to work backwards to the genesis block by following the * prevBlockHash pointers in the block headers.

* - *

The genesis blocks for both test and prod networks contain the timestamp of when they were created, + *

The genesis blocks for both test and main networks contain the timestamp of when they were created, * and a message in the coinbase transaction. It says, "The Times 03/Jan/2009 Chancellor on brink of second * bailout for banks".

*/ @@ -305,7 +305,7 @@ public abstract class NetworkParameters implements Serializable { /** * How much time in seconds is supposed to pass between "interval" blocks. If the actual elapsed time is * significantly different from this value, the network difficulty formula will produce a different value. Both - * test and production Bitcoin networks use 2 weeks (1209600 seconds). + * test and main Bitcoin networks use 2 weeks (1209600 seconds). */ public int getTargetTimespan() { return targetTimespan; diff --git a/core/src/main/java/org/bitcoinj/core/PeerAddress.java b/core/src/main/java/org/bitcoinj/core/PeerAddress.java index a508b8e5..bfedcbc0 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerAddress.java +++ b/core/src/main/java/org/bitcoinj/core/PeerAddress.java @@ -90,7 +90,7 @@ public class PeerAddress extends ChildMessage { } /** - * Constructs a peer address from the given IP address. Port and protocol version are default for the prodnet. + * Constructs a peer address from the given IP address. Port and protocol version are default for the mainnet. */ public PeerAddress(InetAddress addr) { this(addr, MainNetParams.get().getPort()); diff --git a/core/src/main/java/org/bitcoinj/net/discovery/IrcDiscovery.java b/core/src/main/java/org/bitcoinj/net/discovery/IrcDiscovery.java index 5a2b155f..0ad62556 100644 --- a/core/src/main/java/org/bitcoinj/net/discovery/IrcDiscovery.java +++ b/core/src/main/java/org/bitcoinj/net/discovery/IrcDiscovery.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; /** * IrcDiscovery provides a way to find network peers by joining a pre-agreed rendevouz point on the LFnet IRC network. - * This class is deprecated because LFnet has ceased to operate and DNS seeds now exist for both prod and test + * This class is deprecated because LFnet has ceased to operate and DNS seeds now exist for both main and test * networks. It may conceivably still be useful for running small ad-hoc networks by yourself. */ @Deprecated @@ -49,7 +49,7 @@ public class IrcDiscovery implements PeerDiscovery { * Finds a list of peers by connecting to an IRC network, joining a channel, decoding the nicks and then * disconnecting. * - * @param channel The IRC channel to join, either "#bitcoin" or "#bitcoinTEST3" for the production and test networks + * @param channel The IRC channel to join, either "#bitcoin" or "#bitcoinTEST3" for the main and test networks * respectively. */ public IrcDiscovery(String channel) { @@ -61,7 +61,7 @@ public class IrcDiscovery implements PeerDiscovery { * disconnecting. * * @param server Name or textual IP address of the IRC server to join. - * @param channel The IRC channel to join, either "#bitcoin" or "#bitcoinTEST3" for the production and test networks + * @param channel The IRC channel to join, either "#bitcoin" or "#bitcoinTEST3" for the main and test networks */ public IrcDiscovery(String channel, String server, int port) { this.channel = channel; diff --git a/core/src/main/java/org/bitcoinj/params/package-info.java b/core/src/main/java/org/bitcoinj/params/package-info.java index e750d96b..69d263ff 100644 --- a/core/src/main/java/org/bitcoinj/params/package-info.java +++ b/core/src/main/java/org/bitcoinj/params/package-info.java @@ -1,5 +1,5 @@ /** - * Network parameters encapsulate some of the differences between different Bitcoin networks such as the main/production + * Network parameters encapsulate some of the differences between different Bitcoin networks such as the main * network, the testnet, regtest mode, unit testing params and so on. */ package org.bitcoinj.params; \ No newline at end of file diff --git a/core/src/main/java/org/bitcoinj/store/H2FullPrunedBlockStore.java b/core/src/main/java/org/bitcoinj/store/H2FullPrunedBlockStore.java index d95ceeec..2795d150 100644 --- a/core/src/main/java/org/bitcoinj/store/H2FullPrunedBlockStore.java +++ b/core/src/main/java/org/bitcoinj/store/H2FullPrunedBlockStore.java @@ -352,7 +352,7 @@ public class H2FullPrunedBlockStore implements FullPrunedBlockStore { PreparedStatement s = conn.get().prepareStatement("INSERT INTO headers(hash, chainWork, height, header, wasUndoable)" + " VALUES(?, ?, ?, ?, ?)"); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 3, hashBytes, 0, 28); s.setBytes(1, hashBytes); @@ -370,7 +370,7 @@ public class H2FullPrunedBlockStore implements FullPrunedBlockStore { PreparedStatement s = conn.get().prepareStatement("UPDATE headers SET wasUndoable=? WHERE hash=?"); s.setBoolean(1, true); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 3, hashBytes, 0, 28); s.setBytes(2, hashBytes); @@ -392,7 +392,7 @@ public class H2FullPrunedBlockStore implements FullPrunedBlockStore { @Override public void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException { maybeConnect(); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 3, hashBytes, 0, 28); int height = storedBlock.getHeight(); @@ -474,7 +474,7 @@ public class H2FullPrunedBlockStore implements FullPrunedBlockStore { PreparedStatement s = null; try { s = conn.get().prepareStatement("SELECT chainWork, height, header, wasUndoable FROM headers WHERE hash = ?"); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(hash.getBytes(), 3, hashBytes, 0, 28); s.setBytes(1, hashBytes); @@ -530,7 +530,7 @@ public class H2FullPrunedBlockStore implements FullPrunedBlockStore { try { s = conn.get() .prepareStatement("SELECT txOutChanges, transactions FROM undoableBlocks WHERE hash = ?"); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(hash.getBytes(), 3, hashBytes, 0, 28); s.setBytes(1, hashBytes); diff --git a/core/src/main/java/org/bitcoinj/store/PostgresFullPrunedBlockStore.java b/core/src/main/java/org/bitcoinj/store/PostgresFullPrunedBlockStore.java index 5a972c5e..41272782 100644 --- a/core/src/main/java/org/bitcoinj/store/PostgresFullPrunedBlockStore.java +++ b/core/src/main/java/org/bitcoinj/store/PostgresFullPrunedBlockStore.java @@ -426,7 +426,7 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore { PreparedStatement s = conn.get().prepareStatement("INSERT INTO headers(hash, chainWork, height, header, wasUndoable)" + " VALUES(?, ?, ?, ?, ?)"); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 3, hashBytes, 0, 28); s.setBytes(1, hashBytes); @@ -444,7 +444,7 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore { PreparedStatement s = conn.get().prepareStatement("UPDATE headers SET wasUndoable=? WHERE hash=?"); s.setBoolean(1, true); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 3, hashBytes, 0, 28); s.setBytes(2, hashBytes); @@ -466,7 +466,7 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore { @Override public void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException { maybeConnect(); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 3, hashBytes, 0, 28); int height = storedBlock.getHeight(); @@ -570,7 +570,7 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore { try { s = conn.get() .prepareStatement("SELECT chainWork, height, header, wasUndoable FROM headers WHERE hash = ?"); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(hash.getBytes(), 3, hashBytes, 0, 28); s.setBytes(1, hashBytes); @@ -623,7 +623,7 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore { try { s = conn.get() .prepareStatement("SELECT txOutChanges, transactions FROM undoableBlocks WHERE hash = ?"); - // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes + // We skip the first 4 bytes because (on mainnet) the minimum target has 4 0-bytes byte[] hashBytes = new byte[28]; System.arraycopy(hash.getBytes(), 3, hashBytes, 0, 28); diff --git a/core/src/test/java/org/bitcoinj/core/CoinbaseBlockTest.java b/core/src/test/java/org/bitcoinj/core/CoinbaseBlockTest.java index 50ddca6d..6a9e8e34 100644 --- a/core/src/test/java/org/bitcoinj/core/CoinbaseBlockTest.java +++ b/core/src/test/java/org/bitcoinj/core/CoinbaseBlockTest.java @@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; /** - * Test that an example production coinbase transactions can be added to a wallet ok. + * Test that an example mainnet coinbase transactions can be added to a wallet ok. */ public class CoinbaseBlockTest { static final NetworkParameters params = MainNetParams.get(); diff --git a/core/src/wallet.proto b/core/src/wallet.proto index 27dad389..7d00529d 100644 --- a/core/src/wallet.proto +++ b/core/src/wallet.proto @@ -343,7 +343,7 @@ message Wallet { } required string network_identifier = 1; // the network used by this wallet - // org.bitcoin.production = production network (Satoshi genesis block) + // org.bitcoin.production = main, production network (Satoshi genesis block) // org.bitcoin.test = test network (Andresen genesis block) // The SHA256 hash of the head of the best chain seen by this wallet.