aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-05-15 00:57:29 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-05-15 00:57:29 +0800
commit12f82ab2ff71e1d93610a40cf206f3e3d3faa70d (patch)
treea6e98332c7e0a7c763d9799ea7622314346bd954
parentf7fdb4dfbe1a0851b6fb2970b0a6b11fd31273d6 (diff)
downloaddexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.tar
dexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.tar.gz
dexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.tar.bz2
dexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.tar.lz
dexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.tar.xz
dexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.tar.zst
dexon-12f82ab2ff71e1d93610a40cf206f3e3d3faa70d.zip
Check for error on DB fetch of tx
-rw-r--r--xeth/xeth.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 0fe68d175..0d16393c2 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -318,7 +318,11 @@ func (self *XEth) EthTransactionByHash(hash string) (tx *types.Transaction, blha
Index uint64
}
- v, _ := self.backend.ExtraDb().Get(append(common.FromHex(hash), 0x0001))
+ v, dberr := self.backend.ExtraDb().Get(append(common.FromHex(hash), 0x0001))
+ // TODO check specifically for ErrNotFound
+ if dberr != nil {
+ return
+ }
r := bytes.NewReader(v)
err := rlp.Decode(r, &txExtra)
if err == nil {