sealer

package
v0.0.0-...-8f649d9 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DevMode  bool
	Coinbase types.Address
	Extra    []byte
}

Config is the sealer config

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig is the default sealer config

type SealedNotify

type SealedNotify struct {
	Block *types.Block
}

TODO; this one is tricky

type Sealer

type Sealer struct {
	SealedCh chan *SealedNotify
	// contains filtered or unexported fields
}

Sealer seals blocks

func NewSealer

func NewSealer(config *Config, logger hclog.Logger, blockchain *blockchain.Blockchain, engine consensus.Consensus, executor *state.Executor) *Sealer

NewSealer creates a new sealer for a specific engine

func (*Sealer) AddTx

func (s *Sealer) AddTx(tx *types.Transaction) error

AddTx adds a new transaction to the transaction pool

func (*Sealer) SetEnabled

func (s *Sealer) SetEnabled(enabled bool)

SetEnabled enables or disables the sealer

type TxPool

type TxPool struct {
	// contains filtered or unexported fields
}

TxPool is a pool of transactions

func NewTxPool

func NewTxPool(blockchain *blockchain.Blockchain) *TxPool

NewTxPool creates a new pool of transactios

func (*TxPool) Add

func (t *TxPool) Add(tx *types.Transaction) error

Add adds a new transaction to the pool

func (*TxPool) Pending

func (t *TxPool) Pending() []*types.Transaction

func (*TxPool) SetSigner

func (t *TxPool) SetSigner(signer crypto.TxSigner)

SetSigner changes the signer

func (*TxPool) Update

func (t *TxPool) Update(b *types.Block, state *state.Txn) error

Jump to

Keyboard shortcuts

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