xeth: getTransactionByHash, try pool if db fails

This commit is contained in:
obscuren 2015-05-07 18:23:24 +02:00
parent dcfecebe1f
commit 60b5a94428

View File

@ -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