MCPcopy Create free account
hub / github.com/CPChain/chain / Status

Method Status

core/tx_pool.go:969–985  ·  view source on GitHub ↗

Status returns the status (unknown/pending/queued) of a batch of transactions identified by their hashes.

(hashes []common.Hash)

Source from the content-addressed store, hash-verified

967// Status returns the status (unknown/pending/queued) of a batch of transactions
968// identified by their hashes.
969func (pool *TxPool) Status(hashes []common.Hash) []TxStatus {
970 pool.mu.RLock()
971 defer pool.mu.RUnlock()
972
973 status := make([]TxStatus, len(hashes))
974 for i, hash := range hashes {
975 if tx := pool.all.Get(hash); tx != nil {
976 from, _ := types.Sender(pool.signer, tx) // already validated
977 if pool.getPendingTxList(from) != nil && pool.getPendingTxList(from).txs.items[tx.Nonce()] != nil {
978 status[i] = TxStatusPending
979 } else {
980 status[i] = TxStatusQueued
981 }
982 }
983 }
984 return status
985}
986
987// Get returns a transaction if it is contained in the pool
988// and nil otherwise.

Callers 1

Calls 4

getPendingTxListMethod · 0.95
GetMethod · 0.65
SenderMethod · 0.65
NonceMethod · 0.65

Tested by 1