Documentation ¶
Index ¶
- Constants
- Variables
- type TransactionPool
- func (pool *TransactionPool) AddTransaction(tx *types.Transaction, isLocal bool) error
- func (pool *TransactionPool) GetMiniPendingNonce(addr *crypto.CommonAddress) uint64
- func (pool *TransactionPool) GetPending(GasLimit *big.Int) []*types.Transaction
- func (pool *TransactionPool) GetQueue() []*types.Transaction
- func (pool *TransactionPool) GetTransactionCount(address *crypto.CommonAddress) uint64
- func (pool *TransactionPool) GetTransactions(addr *crypto.CommonAddress) []types.Transactions
- func (pool *TransactionPool) GetTxInPool(hash string) (*types.Transaction, error)
- func (pool *TransactionPool) NewTxFeed() *event.Feed
- func (pool *TransactionPool) Start(feed *event.Feed, tipRoot []byte)
- func (pool *TransactionPool) Stop()
Constants ¶
View Source
const (
MODULENAME = "txpool"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type TransactionPool ¶
type TransactionPool struct {
// contains filtered or unexported fields
}
TransactionPool ... 1 池子里的交易按照nonce是否连续,分为乱序的和已经排序的在两个不同的队列中 2 已经排序好的可以被打包入块 3 池子里面的交易根据块中的各个地址的交易对应的Nonce进行删除
func NewTransactionPool ¶
func NewTransactionPool(chainStore store.StoreInterface, journalPath string) *TransactionPool
NewTransactionPool 创建一个交易池
func (*TransactionPool) AddTransaction ¶
func (pool *TransactionPool) AddTransaction(tx *types.Transaction, isLocal bool) error
AddTransaction 交易加入到txpool
func (*TransactionPool) GetMiniPendingNonce ¶
func (pool *TransactionPool) GetMiniPendingNonce(addr *crypto.CommonAddress) uint64
GetMiniPendingNonce 获取Pending队列中的最小nonce
func (*TransactionPool) GetPending ¶
func (pool *TransactionPool) GetPending(GasLimit *big.Int) []*types.Transaction
GetPending 打包过程获取交易,进行打包处理
func (*TransactionPool) GetQueue ¶
func (pool *TransactionPool) GetQueue() []*types.Transaction
GetQueue 获取交易池中,非严格排序队列中的所有交易
func (*TransactionPool) GetTransactionCount ¶
func (pool *TransactionPool) GetTransactionCount(address *crypto.CommonAddress) uint64
GetTransactionCount 获取总的交易个数,即获取地址对应的nonce
func (*TransactionPool) GetTransactions ¶
func (pool *TransactionPool) GetTransactions(addr *crypto.CommonAddress) []types.Transactions
GetTransactions 获取当前池子中所有交易
func (*TransactionPool) GetTxInPool ¶
func (pool *TransactionPool) GetTxInPool(hash string) (*types.Transaction, error)
GetTxInPool 获取交易池中的交易
func (*TransactionPool) NewTxFeed ¶
func (pool *TransactionPool) NewTxFeed() *event.Feed
Click to show internal directories.
Click to hide internal directories.