Documentation ¶
Index ¶
- type BlockCreator
- func (b *BlockCreator) Close() error
- func (bc *BlockCreator) ProcessConsensusChange(cc modules.ConsensusChange)
- func (bc *BlockCreator) ReceiveUpdatedUnconfirmedTransactions(unconfirmedTransactions []types.Transaction, _ modules.ConsensusChange) error
- func (bc *BlockCreator) RespentBlockStake(ubso types.UnspentBlockStakeOutput) error
- func (bc *BlockCreator) SolveBlocks()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockCreator ¶
type BlockCreator struct {
// contains filtered or unexported fields
}
BlockCreator participates in the Proof Of Block Stake protocol for creating new blocks
func New ¶
func New(cs modules.ConsensusSet, tpool modules.TransactionPool, w modules.Wallet, persistDir string, bcInfo types.BlockchainInfo, chainCts types.ChainConstants, verboseLogging bool) (*BlockCreator, error)
New returns a block creator that is collaborating in the pobs protocol.
func (*BlockCreator) Close ¶
func (b *BlockCreator) Close() error
Close terminates all ongoing processes involving the block creator, enabling garbage collection.
func (*BlockCreator) ProcessConsensusChange ¶
func (bc *BlockCreator) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange will update the blockcreator's most recent block.
func (*BlockCreator) ReceiveUpdatedUnconfirmedTransactions ¶
func (bc *BlockCreator) ReceiveUpdatedUnconfirmedTransactions(unconfirmedTransactions []types.Transaction, _ modules.ConsensusChange) error
ReceiveUpdatedUnconfirmedTransactions will replace the current unconfirmed set of transactions with the input transactions.
func (*BlockCreator) RespentBlockStake ¶
func (bc *BlockCreator) RespentBlockStake(ubso types.UnspentBlockStakeOutput) error
RespentBlockStake will spent the unspent block stake output which is needed for the POBS algorithm. The transaction created will be the first transaction in the block to avoid the BlockStakeAging for later use of this block stake.
func (*BlockCreator) SolveBlocks ¶
func (bc *BlockCreator) SolveBlocks()
SolveBlocks participates in the Proof Of Block Stake protocol by continuously checking if unspent block stake outputs make a solution for the current unsolved block. If a match is found, the block is submitted to the consensus set. This function does not return until the blockcreator threadgroup is stopped.