mempool

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendToTxPoolEvent added in v0.5.0

type AppendToTxPoolEvent func(tx *types.Transaction) errors.ELAError

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 ConfirmInfo added in v0.3.4

type ConfirmInfo struct {
	Confirm *payload.Confirm
	Height  uint32
}

type PopBackEvent added in v0.5.0

type PopBackEvent func(common.Uint256)

type TxPool

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

func NewTxPool added in v0.3.0

func NewTxPool(params *config.Params) *TxPool

func (*TxPool) AppendToTxPool added in v0.3.0

func (mp *TxPool) AppendToTxPool(tx *Transaction) elaerr.ELAError

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

func (*TxPool) AppendToTxPoolWithoutEvent added in v0.7.0

func (mp *TxPool) AppendToTxPoolWithoutEvent(tx *Transaction) elaerr.ELAError

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

func (*TxPool) AppendTx added in v0.5.0

func (m *TxPool) AppendTx(tx *types.Transaction) errors.ELAError

func (*TxPool) BroadcastSmallCrossChainTransactions added in v0.8.0

func (mp *TxPool) BroadcastSmallCrossChainTransactions(bestHeight uint32)

func (*TxPool) CheckAndCleanAllTransactions added in v0.7.0

func (mp *TxPool) CheckAndCleanAllTransactions()

func (*TxPool) CleanSubmittedTransactions

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

clean the transaction Pool with committed block.

func (*TxPool) ContainsKey added in v0.5.0

func (m *TxPool) ContainsKey(key interface{}, slotName string) bool

func (TxPool) DataExtension added in v0.5.0

func (c TxPool) DataExtension() string

func (TxPool) Deserialize added in v0.5.0

func (c TxPool) Deserialize(r io.Reader) (err error)

func (TxPool) EffectivePeriod added in v0.5.0

func (c TxPool) EffectivePeriod() uint32

func (*TxPool) Empty added in v0.5.0

func (m *TxPool) Empty() bool

func (TxPool) Generator added in v0.5.0

func (c TxPool) Generator() func(buf []byte) checkpoint.ICheckPoint

func (TxPool) GetHeight added in v0.5.0

func (c TxPool) GetHeight() uint32

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) GetTx added in v0.5.0

func (m *TxPool) GetTx(key interface{},
	slotName string) *types.Transaction

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) GetUsedUTXOs added in v0.5.0

func (mp *TxPool) GetUsedUTXOs() map[string]struct{}

GetUsedUTXO returns all used refer keys of inputs.

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) IsDuplicateSidechainReturnDepositTx added in v0.8.0

func (mp *TxPool) IsDuplicateSidechainReturnDepositTx(sidechainReturnDepositTxHash Uint256) bool

func (*TxPool) IsDuplicateSidechainTx

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

func (TxPool) Key added in v0.5.0

func (c TxPool) Key() string

func (TxPool) LogError added in v0.5.0

func (c TxPool) LogError(err error)

func (*TxPool) MaybeAcceptTransaction

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

func (TxPool) OnBlockSaved added in v0.5.0

func (c TxPool) OnBlockSaved(block *types.DposBlock)

func (TxPool) OnInit added in v0.5.0

func (c TxPool) OnInit()

func (TxPool) OnRollbackSeekTo added in v0.8.0

func (c TxPool) OnRollbackSeekTo(uint32)

func (TxPool) OnRollbackTo added in v0.5.0

func (c TxPool) OnRollbackTo(uint32) error

func (TxPool) Priority added in v0.5.0

func (c TxPool) Priority() checkpoint.Priority

func (*TxPool) RemoveKey added in v0.5.0

func (m *TxPool) RemoveKey(key interface{},
	slotName string) errors.ELAError

func (*TxPool) RemoveTransaction

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

func (TxPool) SavePeriod added in v0.5.0

func (c TxPool) SavePeriod() uint32

func (TxPool) Serialize added in v0.5.0

func (c TxPool) Serialize(w io.Writer) (err error)

func (TxPool) SetHeight added in v0.5.0

func (c TxPool) SetHeight(height uint32)

func (TxPool) Snapshot added in v0.5.0

func (c TxPool) Snapshot() checkpoint.ICheckPoint

func (TxPool) StartHeight added in v0.5.0

func (c TxPool) StartHeight() uint32

func (*TxPool) VerifyTx added in v0.5.0

func (m *TxPool) VerifyTx(tx *types.Transaction) errors.ELAError

Jump to

Keyboard shortcuts

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