xeth: getTransactionByHash, try pool if db fails
This commit is contained in:
parent
dcfecebe1f
commit
60b5a94428
|
@ -235,6 +235,8 @@ func (self *XEth) EthTransactionByHash(hash string) (tx *types.Transaction, blha
|
|||
data, _ := self.backend.ExtraDb().Get(common.FromHex(hash))
|
||||
if len(data) != 0 {
|
||||
tx = types.NewTransactionFromBytes(data)
|
||||
} else { // check pending transactions
|
||||
tx = self.backend.TxPool().GetTransaction(common.HexToHash(hash))
|
||||
}
|
||||
|
||||
// meta
|
||||
|
|
Loading…
Reference in New Issue