blockcreator

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 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

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)

ReceiveUpdatedUnconfirmedTransactions will replace the current unconfirmed set of transactions with the input transactions.

func (*BlockCreator) RespentBlockStake

func (bc *BlockCreator) RespentBlockStake(ubso types.UnspentBlockStakeOutput)

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 continously 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