GetTransaction returns a transaction if it is contained in the pool and nil otherwise.
(hash common.Uint256)
| 165 | // GetTransaction returns a transaction if it is contained in the pool |
| 166 | // and nil otherwise. |
| 167 | func (tp *TXPool) GetTransaction(hash common.Uint256) *types.Transaction { |
| 168 | tp.RLock() |
| 169 | defer tp.RUnlock() |
| 170 | if tx := tp.txList[hash]; tx == nil { |
| 171 | return nil |
| 172 | } |
| 173 | return tp.txList[hash].Tx |
| 174 | } |
| 175 | |
| 176 | // GetTxStatus returns a transaction status if it is contained in the pool |
| 177 | // and nil otherwise. |