mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-24 12:27:17 +00:00
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))
|
data, _ := self.backend.ExtraDb().Get(common.FromHex(hash))
|
||||||
if len(data) != 0 {
|
if len(data) != 0 {
|
||||||
tx = types.NewTransactionFromBytes(data)
|
tx = types.NewTransactionFromBytes(data)
|
||||||
|
} else { // check pending transactions
|
||||||
|
tx = self.backend.TxPool().GetTransaction(common.HexToHash(hash))
|
||||||
}
|
}
|
||||||
|
|
||||||
// meta
|
// meta
|
||||||
|
Loading…
Reference in New Issue
Block a user