mempool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockPool

type BlockPool struct {
	Chain     *blockchain.BlockChain
	Store     blockchain.IChainStore
	IsCurrent func() bool

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewBlockPool added in v0.3.0

func NewBlockPool(params *config.Params) *BlockPool

func (*BlockPool) AddDposBlock added in v0.3.0

func (bm *BlockPool) AddDposBlock(dposBlock *types.DposBlock) (bool, bool, error)

func (*BlockPool) AddToBlockMap

func (bm *BlockPool) AddToBlockMap(block *types.Block)

func (*BlockPool) AddToConfirmMap

func (bm *BlockPool) AddToConfirmMap(confirm *payload.Confirm)

func (*BlockPool) AppendConfirm

func (bm *BlockPool) AppendConfirm(confirm *payload.Confirm) (bool,
	bool, error)

func (*BlockPool) AppendDposBlock

func (bm *BlockPool) AppendDposBlock(dposBlock *types.DposBlock) (bool, bool, error)

func (*BlockPool) CheckConfirmedBlockOnFork added in v0.3.0

func (bm *BlockPool) CheckConfirmedBlockOnFork(height uint32, block *types.Block) error

func (*BlockPool) CleanFinalConfirmedBlock added in v0.3.0

func (bm *BlockPool) CleanFinalConfirmedBlock(height uint32)

func (*BlockPool) ConfirmBlock

func (bm *BlockPool) ConfirmBlock(hash common.Uint256) (bool, bool, error)

func (*BlockPool) GetBlock

func (bm *BlockPool) GetBlock(hash common.Uint256) (*types.Block, bool)

func (*BlockPool) GetConfirm

func (bm *BlockPool) GetConfirm(hash common.Uint256) (
	*payload.Confirm, bool)

func (*BlockPool) GetDposBlockByHash added in v0.3.0

func (bm *BlockPool) GetDposBlockByHash(hash common.Uint256) (*types.DposBlock, error)

type TxPool

type TxPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTxPool added in v0.3.0

func NewTxPool() *TxPool

func (*TxPool) AppendToTxPool added in v0.3.0

func (mp *TxPool) AppendToTxPool(txn *Transaction) error

func (*TxPool) AppendToTxnPool

func (mp *TxPool) AppendToTxnPool(tx *Transaction) ErrCode

append transaction to txnpool when check ok. 1.check 2.check with ledger(db) 3.check with pool

func (*TxPool) CleanSubmittedTransactions

func (mp *TxPool) CleanSubmittedTransactions(block *Block)

clean the trasaction Pool with committed block.

func (*TxPool) GetTransaction

func (mp *TxPool) GetTransaction(hash Uint256) *Transaction

get the transaction by hash

func (*TxPool) GetTransactionCount

func (mp *TxPool) GetTransactionCount() int

func (*TxPool) GetTxsInPool added in v0.3.0

func (mp *TxPool) GetTxsInPool() []*Transaction

GetTxsInPool returns a slice of all transactions in the mp.

This function is safe for concurrent access.

func (*TxPool) HaveTransaction added in v0.3.0

func (mp *TxPool) HaveTransaction(txId Uint256) bool

HaveTransaction returns if a transaction is in transaction pool by the given transaction id. If no transaction match the transaction id, return false

func (*TxPool) IsDuplicateSidechainTx

func (mp *TxPool) IsDuplicateSidechainTx(sidechainTxHash Uint256) bool

func (*TxPool) MaybeAcceptTransaction

func (mp *TxPool) MaybeAcceptTransaction(tx *Transaction) error

func (*TxPool) RemoveTransaction

func (mp *TxPool) RemoveTransaction(txn *Transaction)

Jump to

Keyboard shortcuts

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