state

package
v0.0.0-...-c820c6a Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MiningReward = big.NewInt(1000000)

Functions

This section is empty.

Types

type Miner

type Miner struct {
	StateMgr *StateManager
	// contains filtered or unexported fields
}

func NewMiner

func NewMiner(bcb func(*types.Block) error, txp *types.TransactionPool, bestBlock *types.Block, coinbase types.Address, cs *hamt.CborIpldStore) *Miner

func (*Miner) Run

func (m *Miner) Run(ctx context.Context)

type StateManager

type StateManager struct {
	BestBlock *types.Block
	HeadCid   *cid.Cid

	StateRoot *contract.State

	TxPool *types.TransactionPool

	KnownGoodBlocks *cid.Set

	Miner *Miner
	// contains filtered or unexported fields
}

StateManager manages the current state of the chain and handles validating and applying updates.

func NewStateManager

func NewStateManager(cs *hamt.CborIpldStore, dag ipld.DAGService) *StateManager

func (*StateManager) BlockNotifications

func (st *StateManager) BlockNotifications(ctx context.Context) <-chan *types.Block

func (*StateManager) GetStateRoot

func (s *StateManager) GetStateRoot() *contract.State

func (*StateManager) Inform

func (s *StateManager) Inform(p peer.ID, blk *types.Block)

Inform informs the state manager that we received a new block from the given peer

func (*StateManager) InformTx

func (st *StateManager) InformTx(tx *types.Transaction)

func (*StateManager) ProcessNewBlock

func (s *StateManager) ProcessNewBlock(ctx context.Context, blk *types.Block) error

func (*StateManager) SetBestBlock

func (s *StateManager) SetBestBlock(b *types.Block)

Jump to

Keyboard shortcuts

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