Documentation ¶
Index ¶
- func CheckBlock(db database.DB, prevBlock block.Block, blk block.Block) error
- func CheckBlockCertificate(committee committee.Foldable, blk block.Block) error
- func CheckBlockHeader(prevBlock block.Block, blk block.Block) error
- func CheckMultiCoinbases(txs []transactions.Transaction) error
- func CheckSpecialFields(txIndex uint64, blockTime uint64, tx transactions.Transaction) error
- func CheckStandardTx(db database.DB, tx transactions.Standard) error
- func CheckTx(db database.DB, index uint64, blockTime uint64, tx transactions.Transaction) error
- func VerifyBid(index uint64, blockTime uint64, tx *transactions.Bid) error
- func VerifyCoinbase(txIndex uint64, tx *transactions.Coinbase) error
- func VerifyStake(index uint64, blockTime uint64, tx *transactions.Stake) error
- func VerifyStandard(tx *transactions.Standard) error
- func VerifyTimelock(index uint64, blockTime uint64, tx *transactions.TimeLock) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBlock ¶
CheckBlock will verify whether a block is valid according to the rules of the consensus returns nil if a block is valid
func CheckBlockCertificate ¶
CheckBlockCertificate ensures that the block certificate is valid.
func CheckBlockHeader ¶
CheckBlockHeader checks whether a block header is malformed, These are stateless and stateful checks returns nil, if all checks pass
func CheckMultiCoinbases ¶
func CheckMultiCoinbases(txs []transactions.Transaction) error
CheckMultiCoinbases returns an error if there is more than one coinbase transaction
in the list or if there are none
func CheckSpecialFields ¶
func CheckSpecialFields(txIndex uint64, blockTime uint64, tx transactions.Transaction) error
CheckSpecialFields TBD
func CheckStandardTx ¶
func CheckStandardTx(db database.DB, tx transactions.Standard) error
CheckStandardTx checks whether the standard fields are correct against the passed blockchain db. These checks are both stateless and stateful.
func CheckTx ¶
func CheckTx(db database.DB, index uint64, blockTime uint64, tx transactions.Transaction) error
CheckTx will verify whether a transaction is valid by checking: - It has not been double spent - It is not malformed Index indicates the position that the transaction is in, in a block If it is a solo transaction, this is set to 0 blockTime indicates what time the transaction will be included in a block If it is a solo transaction, the blockTime is calculated by using currentBlockTime+consensusSeconds Returns nil if a tx is valid
func VerifyCoinbase ¶
func VerifyCoinbase(txIndex uint64, tx *transactions.Coinbase) error
func VerifyStake ¶
func VerifyStake(index uint64, blockTime uint64, tx *transactions.Stake) error
func VerifyStandard ¶
func VerifyStandard(tx *transactions.Standard) error
func VerifyTimelock ¶
func VerifyTimelock(index uint64, blockTime uint64, tx *transactions.TimeLock) error
Types ¶
This section is empty.