Documentation ¶
Index ¶
- Variables
- type FRet
- type Iterator
- type SortedTxMap
- type TxPImpl
- func (pool *TxPImpl) AddLinkedNode(linkedNode *blockcache.BlockCacheNode) error
- func (pool *TxPImpl) AddTx(t *tx.Tx, from string) error
- func (pool *TxPImpl) Close()
- func (pool *TxPImpl) DelTx(hash []byte) error
- func (pool *TxPImpl) ExistTxs(hash []byte, chainBlock *block.Block) bool
- func (pool *TxPImpl) GetFromChain(hash []byte) (*tx.Tx, *tx.TxReceipt, error)
- func (pool *TxPImpl) GetFromPending(hash []byte) (*tx.Tx, error)
- func (pool *TxPImpl) PendingTx() (*SortedTxMap, *blockcache.BlockCacheNode)
- type TxPool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDupPendingTx = errors.New("tx exists in pending") ErrDupChainTx = errors.New("tx exists in chain") ErrCacheFull = errors.New("txpool is full") ErrTxNotFound = errors.New("tx not found") )
Values.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator This is the iterator
type SortedTxMap ¶
type SortedTxMap struct {
// contains filtered or unexported fields
}
SortedTxMap is a red black tree of tx.
func NewSortedTxMap ¶
func NewSortedTxMap() *SortedTxMap
NewSortedTxMap returns a new SortedTxMap instance.
func (*SortedTxMap) Iter ¶
func (st *SortedTxMap) Iter() *Iterator
Iter returns the iterator of SortedTxMap.
type TxPImpl ¶
type TxPImpl struct {
// contains filtered or unexported fields
}
TxPImpl defines all the API of txpool package.
func NewTxPoolImpl ¶
func NewTxPoolImpl(bChain block.Chain, blockCache blockcache.BlockCache) (*TxPImpl, error)
NewTxPoolImpl returns a default TxPImpl instance.
func (*TxPImpl) AddLinkedNode ¶
func (pool *TxPImpl) AddLinkedNode(linkedNode *blockcache.BlockCacheNode) error
AddLinkedNode add the findBlock
func (*TxPImpl) GetFromChain ¶
GetFromChain gets transaction from longest chain.
func (*TxPImpl) GetFromPending ¶
GetFromPending gets transaction from pending list.
func (*TxPImpl) PendingTx ¶
func (pool *TxPImpl) PendingTx() (*SortedTxMap, *blockcache.BlockCacheNode)
PendingTx is return pendingTx
type TxPool ¶
type TxPool interface { Close() AddTx(tx *tx.Tx, from string) error DelTx(hash []byte) error GetFromPending(hash []byte) (*tx.Tx, error) PendingTx() (*SortedTxMap, *blockcache.BlockCacheNode) // TODO: The following interfaces need to be moved from txpool to chainbase. AddLinkedNode(linkedNode *blockcache.BlockCacheNode) error ExistTxs(hash []byte, chainBlock *block.Block) bool GetFromChain(hash []byte) (*tx.Tx, *tx.TxReceipt, error) }
TxPool defines all the API of txpool package.
Click to show internal directories.
Click to hide internal directories.