public abstract class AbstractBitcoinNetParams extends NetworkParameters
NetworkParameters.ProtocolVersion| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BITCOIN_SCHEME
Scheme part for Bitcoin URIs.
|
protected Block |
genesisBlock
lazy-initialized by the first call to
NetworkParameters.getGenesisBlock() |
static int |
REWARD_HALVING_INTERVAL |
addressHeader, addrSeeds, BIP16_ENFORCE_TIME, bip32HeaderP2PKHpriv, bip32HeaderP2PKHpub, bip32HeaderP2WPKHpriv, bip32HeaderP2WPKHpub, checkpoints, defaultSerializer, dnsSeeds, dumpedPrivateKeyHeader, httpSeeds, id, ID_MAINNET, ID_REGTEST, ID_TESTNET, ID_UNITTESTNET, interval, INTERVAL, majorityEnforceBlockUpgrade, majorityRejectBlockOutdated, majorityWindow, MAX_COINS, MAX_MONEY, maxTarget, p2shHeader, packetMagic, PAYMENT_PROTOCOL_ID_MAINNET, PAYMENT_PROTOCOL_ID_REGTEST, PAYMENT_PROTOCOL_ID_TESTNET, PAYMENT_PROTOCOL_ID_UNIT_TESTS, port, segwitAddressHrp, spendableCoinbaseDepth, subsidyDecreaseBlockCount, TARGET_SPACING, TARGET_TIMESPAN, targetTimespan| Constructor and Description |
|---|
AbstractBitcoinNetParams() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore)
Throws an exception if the block's difficulty is not correct.
|
Coin |
getBlockInflation(int height)
A utility method that calculates how much new Bitcoin would be created by the block at the given height.
|
Coin |
getMaxMoney()
Returns the number of coins that will be produced in total, on this
network.
|
Coin |
getMinNonDustOutput()
Deprecated.
|
MonetaryFormat |
getMonetaryFormat()
The monetary object for this currency.
|
int |
getProtocolVersionNum(NetworkParameters.ProtocolVersion version) |
BitcoinSerializer |
getSerializer(boolean parseRetain)
Construct and return a custom serializer.
|
java.lang.String |
getUriScheme()
Scheme part for URIs, for example "bitcoin".
|
boolean |
hasMaxMoney()
Returns whether this network has a maximum number of coins (finite supply) or
not.
|
boolean |
isDifficultyTransitionPoint(int previousHeight)
Checks if we are at a difficulty transition point.
|
boolean |
isRewardHalvingPoint(int previousHeight)
Checks if we are at a reward halving point.
|
allowEmptyPeerChain, equals, fromID, fromPmtProtocolID, getAddressHeader, getAddrSeeds, getBip32HeaderP2PKHpriv, getBip32HeaderP2PKHpub, getBip32HeaderP2WPKHpriv, getBip32HeaderP2WPKHpub, getBlockVerificationFlags, getDefaultSerializer, getDnsSeeds, getDumpedPrivateKeyHeader, getGenesisBlock, getHttpSeeds, getId, getInterval, getMajorityEnforceBlockUpgrade, getMajorityRejectBlockOutdated, getMajorityWindow, getMaxTarget, getP2SHHeader, getPacketMagic, getPaymentProtocolId, getPort, getSegwitAddressHrp, getSpendableCoinbaseDepth, getSubsidyDecreaseBlockCount, getTargetTimespan, getTransactionVerificationFlags, hashCode, isCheckpoint, passesCheckpointpublic static final java.lang.String BITCOIN_SCHEME
public static final int REWARD_HALVING_INTERVAL
protected Block genesisBlock
NetworkParameters.getGenesisBlock()public final boolean isRewardHalvingPoint(int previousHeight)
previousHeight - The height of the previous stored blockpublic Coin getBlockInflation(int height)
A utility method that calculates how much new Bitcoin would be created by the block at the given height. The inflation of Bitcoin is predictable and drops roughly every 4 years (210,000 blocks). At the dawn of the system it was 50 coins per block, in late 2012 it went to 25 coins per block, and so on. The size of a coinbase transaction is inflation plus fees.
The half-life is controlled by NetworkParameters.getSubsidyDecreaseBlockCount().
height - the height of the block to calculate inflation forpublic final boolean isDifficultyTransitionPoint(int previousHeight)
previousHeight - The height of the previous stored blockpublic void checkDifficultyTransitions(StoredBlock storedPrev, Block nextBlock, BlockStore blockStore) throws VerificationException, BlockStoreException
NetworkParameterscheckDifficultyTransitions in class NetworkParametersVerificationException - if the block's difficulty is not correct.BlockStoreExceptionpublic Coin getMaxMoney()
NetworkParametersgetMaxMoney in class NetworkParameters@Deprecated public Coin getMinNonDustOutput()
TransactionOutput.getMinNonDustValue()getMinNonDustOutput in class NetworkParameterspublic MonetaryFormat getMonetaryFormat()
NetworkParametersgetMonetaryFormat in class NetworkParameterspublic int getProtocolVersionNum(NetworkParameters.ProtocolVersion version)
getProtocolVersionNum in class NetworkParameterspublic BitcoinSerializer getSerializer(boolean parseRetain)
NetworkParametersgetSerializer in class NetworkParameterspublic java.lang.String getUriScheme()
NetworkParametersgetUriScheme in class NetworkParameterspublic boolean hasMaxMoney()
NetworkParametershasMaxMoney in class NetworkParameters