blockcreator

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 15 Imported by: 4

Documentation

Index

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 (b *BlockCreator) ProcessConsensusChange(cc modules.ConsensusChange)

ProcessConsensusChange will update the blockcreator's most recent block.

func (*BlockCreator) ReceiveUpdatedUnconfirmedTransactions

func (b *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 (b *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 (b *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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL