Status returns the status (unknown/pending/queued) of a batch of transactions identified by their hashes.
(hashes []common.Hash)
| 967 | // Status returns the status (unknown/pending/queued) of a batch of transactions |
| 968 | // identified by their hashes. |
| 969 | func (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. |