mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 07:12:17 +00:00
Rewrite most references to prodnet to mainnet in the comments. Does not change any actual code.
This commit is contained in:
parent
8951e8814d
commit
3aac4b0025
@ -47,7 +47,7 @@ public class Address extends VersionedChecksummedBytes {
|
||||
/**
|
||||
* Construct an address from parameters, the address version, and the hash160 form. Example:<p>
|
||||
*
|
||||
* <pre>new Address(NetworkParameters.prodNet(), NetworkParameters.getAddressHeader(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));</pre>
|
||||
* <pre>new Address(MainNetParams.get(), NetworkParameters.getAddressHeader(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));</pre>
|
||||
*/
|
||||
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:<p>
|
||||
*
|
||||
* <pre>new Address(NetworkParameters.prodNet(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));</pre>
|
||||
* <pre>new Address(MainNetParams.get(), Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a"));</pre>
|
||||
*/
|
||||
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:<p>
|
||||
*
|
||||
* <pre>new Address(NetworkParameters.prodNet(), "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL");</pre><p>
|
||||
* <pre>new Address(MainNetParams.get(), "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL");</pre><p>
|
||||
*
|
||||
* @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);
|
||||
|
@ -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() {
|
||||
|
@ -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.</p>
|
||||
*
|
||||
* <p>The genesis blocks for both test and prod networks contain the timestamp of when they were created,
|
||||
* <p>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, <i>"The Times 03/Jan/2009 Chancellor on brink of second
|
||||
* bailout for banks"</i>.</p>
|
||||
*/
|
||||
@ -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;
|
||||
|
@ -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());
|
||||
|
@ -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.
|
||||
* <b>This class is deprecated because LFnet has ceased to operate and DNS seeds now exist for both prod and test
|
||||
* <b>This class is deprecated because LFnet has ceased to operate and DNS seeds now exist for both main and test
|
||||
* networks.</b> 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;
|
||||
|
@ -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;
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user