Package com.bradyrussell.uiscoin.block
Class BlockBuilder
java.lang.Object
com.bradyrussell.uiscoin.block.BlockBuilder
public class BlockBuilder
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description BlockBuilder(BlockchainStorage storage)
-
Method Summary
Modifier and Type Method Description BlockBuilder
addCoinbase(Transaction transaction)
BlockBuilder
addCoinbasePayToPublicKeyHash(byte[] PublicKeyHash)
BlockBuilder
addCoinbasePayToPublicKeyHash(byte[] PublicKeyHash, java.lang.String CoinbaseMessage)
BlockBuilder
addMempoolTransactions(int SizeLimit)
BlockBuilder
addTransaction(Transaction transaction)
BlockBuilder
calculateDifficultyTarget()
BlockBuilder
calculateMerkleRoot()
static Block
createBlockFromMempoolWithCoinbasePayToPublicKeyHash(BlockchainStorage storage, byte[] PublicKeyHash, java.lang.String CoinbaseMessage, int SizeLimit)
Block
get()
BlockBuilder
setBlockHeight(int BlockHeight)
BlockBuilder
setCoinbase(Transaction coinbase)
BlockBuilder
setDifficultyTarget(int DifficultyTarget)
BlockBuilder
setHashPreviousBlock(byte[] PreviousBlockHash)
BlockBuilder
setNonce(int Nonce)
BlockBuilder
setTimestamp(long Time)
BlockBuilder
setVersion(int Version)
BlockBuilder
shuffleTransactions()
-
Constructor Details
-
Method Details
-
setVersion
-
setHashPreviousBlock
-
setTimestamp
-
setBlockHeight
-
setNonce
-
calculateMerkleRoot
-
setDifficultyTarget
-
calculateDifficultyTarget
- Throws:
NoSuchBlockException
-
setCoinbase
-
addTransaction
-
addMempoolTransactions
-
addCoinbase
-
addCoinbasePayToPublicKeyHash
public BlockBuilder addCoinbasePayToPublicKeyHash(byte[] PublicKeyHash) throws NoSuchTransactionException, NoSuchBlockException, InvalidBlockException -
addCoinbasePayToPublicKeyHash
public BlockBuilder addCoinbasePayToPublicKeyHash(byte[] PublicKeyHash, java.lang.String CoinbaseMessage) throws NoSuchTransactionException, NoSuchBlockException, InvalidBlockException -
shuffleTransactions
-
createBlockFromMempoolWithCoinbasePayToPublicKeyHash
public static Block createBlockFromMempoolWithCoinbasePayToPublicKeyHash(BlockchainStorage storage, byte[] PublicKeyHash, java.lang.String CoinbaseMessage, int SizeLimit) throws NoSuchBlockException, InvalidBlockException, NoSuchTransactionException -
get
-