blockproposer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: AGPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockProposer

type BlockProposer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BlockProposer propose several block in specified time range

func NewBlockProposer

func NewBlockProposer(c *protocol.Chain, accountManager *account.Manager, txPool *protocol.TxPool, dispatcher *event.Dispatcher) *BlockProposer

NewBlockProposer returns a new instance of a block proposer for the provided configuration. Use Start to begin the proposal process. See the documentation for BlockProposer type for more details.

func (*BlockProposer) IsProposing

func (b *BlockProposer) IsProposing() bool

IsProposing returns whether the block proposer has been started.

This function is safe for concurrent access.

func (*BlockProposer) Start

func (b *BlockProposer) Start()

Start begins the block propose process as well as the speed monitor used to track hashing metrics. Calling this function when the block proposer has already been started will have no effect.

This function is safe for concurrent access.

func (*BlockProposer) Stop

func (b *BlockProposer) Stop()

Stop gracefully stops the proposal process by signalling all workers, and the speed monitor to quit. Calling this function when the block proposer has not already been started will have no effect.

This function is safe for concurrent access.

Jump to

Keyboard shortcuts

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