Documentation ¶
Index ¶
- Variables
- type FRet
- type Iterator
- type SortedTxMap
- type TAddTx
- type TxPImpl
- func (pool *TxPImpl) AddLinkedNode(linkedNode *blockcache.BlockCacheNode, headNode *blockcache.BlockCacheNode) error
- func (pool *TxPImpl) AddTx(t *tx.Tx) TAddTx
- func (pool *TxPImpl) CheckTxs(txs []*tx.Tx, chainBlock *block.Block) (*tx.Tx, error)
- func (pool *TxPImpl) DelTx(hash []byte) error
- func (pool *TxPImpl) DelTxList(delList []*tx.Tx)
- func (pool *TxPImpl) ExistTxs(hash []byte, chainBlock *block.Block) (FRet, error)
- func (pool *TxPImpl) Lock()
- func (pool *TxPImpl) PendingTxs(maxCnt int) (TxsList, *blockcache.BlockCacheNode, error)
- func (pool *TxPImpl) Release()
- func (pool *TxPImpl) Start() error
- func (pool *TxPImpl) Stop()
- func (pool *TxPImpl) TxIterator() (*Iterator, *blockcache.BlockCacheNode)
- func (pool *TxPImpl) TxTimeOut(tx *tx.Tx) bool
- type TxPool
- type TxsList
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Expiration is the transaction expiration Expiration = int64(90 * time.Second) )
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(global global.BaseVariable, blockCache blockcache.BlockCache, p2ps p2p.Service) (*TxPImpl, error)
NewTxPoolImpl returns a default TxPImpl instance.
func (*TxPImpl) AddLinkedNode ¶
func (pool *TxPImpl) AddLinkedNode(linkedNode *blockcache.BlockCacheNode, headNode *blockcache.BlockCacheNode) error
AddLinkedNode add the block
func (*TxPImpl) PendingTxs ¶
func (pool *TxPImpl) PendingTxs(maxCnt int) (TxsList, *blockcache.BlockCacheNode, error)
PendingTxs get the pending transactions
func (*TxPImpl) TxIterator ¶
func (pool *TxPImpl) TxIterator() (*Iterator, *blockcache.BlockCacheNode)
TxIterator ...
type TxPool ¶
type TxPool interface { Start() error Stop() AddLinkedNode(linkedNode *blockcache.BlockCacheNode, headNode *blockcache.BlockCacheNode) error AddTx(tx *tx.Tx) TAddTx DelTx(hash []byte) error DelTxList(delList []*tx.Tx) TxIterator() (*Iterator, *blockcache.BlockCacheNode) PendingTxs(maxCnt int) (TxsList, *blockcache.BlockCacheNode, error) ExistTxs(hash []byte, chainBlock *block.Block) (FRet, error) CheckTxs(txs []*tx.Tx, chainBlock *block.Block) (*tx.Tx, error) Lock() Release() TxTimeOut(tx *tx.Tx) bool }
TxPool defines all the API of txpool package.
Click to show internal directories.
Click to hide internal directories.