Class BitcoinNetworkParams

    • Constructor Detail

      • BitcoinNetworkParams

        public BitcoinNetworkParams​(BitcoinNetwork network)
        No-args constructor
    • Method Detail

      • fromID

        @Nullable
        public static BitcoinNetworkParams fromID​(java.lang.String id)
        Return network parameters for a network id
        Parameters:
        id - the network id
        Returns:
        the network parameters for the given string ID or NULL if not recognized
      • of

        public static BitcoinNetworkParams of​(BitcoinNetwork network)
        Return network parameters for a BitcoinNetwork enum
        Parameters:
        network - the network
        Returns:
        the network parameters for the given string ID
        Throws:
        java.lang.IllegalArgumentException - if unknown network
      • isRewardHalvingPoint

        public final boolean isRewardHalvingPoint​(int previousHeight)
        Checks if we are at a reward halving point.
        Parameters:
        previousHeight - The height of the previous stored block
        Returns:
        If this is a reward halving point
      • getBlockInflation

        public 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().

        Parameters:
        height - the height of the block to calculate inflation for
        Returns:
        block reward (inflation) for specified block
      • isDifficultyTransitionPoint

        public final boolean isDifficultyTransitionPoint​(int previousHeight)
        Checks if we are at a difficulty transition point.
        Parameters:
        previousHeight - The height of the previous stored block
        Returns:
        If this is a difficulty transition point
      • getMaxMoney

        @Deprecated
        public Coin getMaxMoney()
        Deprecated.
        Description copied from class: NetworkParameters
        Returns the number of coins that will be produced in total, on this network. Where not applicable, a very large number of coins is returned instead (e.g. the main coin issue for Dogecoin).
        Specified by:
        getMaxMoney in class NetworkParameters
        Returns:
        maximum number of coins for this network
      • getUriScheme

        @Deprecated
        public java.lang.String getUriScheme()
        Deprecated.
        Description copied from class: NetworkParameters
        Scheme part for URIs, for example "bitcoin".
        Specified by:
        getUriScheme in class NetworkParameters
        Returns:
        a string with the "scheme" part
      • hasMaxMoney

        @Deprecated
        public boolean hasMaxMoney()
        Deprecated.
        Description copied from class: NetworkParameters
        Returns whether this network has a maximum number of coins (finite supply) or not. Always returns true for Bitcoin, but exists to be overridden for other networks.
        Specified by:
        hasMaxMoney in class NetworkParameters
        Returns:
        true if network has a fixed maximum number of coins