diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-07-04 13:00:23 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-07-04 13:00:23 +0800 |
commit | 481b221279be1673832f96e35e3fdc0f82e178bc (patch) | |
tree | 4efeb12d4685b56a9d137c3b72d6d6184dbf8b53 /core | |
parent | 80eb8f46b7991b80dffe00e52d9fb00a90531bc0 (diff) | |
download | dexon-481b221279be1673832f96e35e3fdc0f82e178bc.tar dexon-481b221279be1673832f96e35e3fdc0f82e178bc.tar.gz dexon-481b221279be1673832f96e35e3fdc0f82e178bc.tar.bz2 dexon-481b221279be1673832f96e35e3fdc0f82e178bc.tar.lz dexon-481b221279be1673832f96e35e3fdc0f82e178bc.tar.xz dexon-481b221279be1673832f96e35e3fdc0f82e178bc.tar.zst dexon-481b221279be1673832f96e35e3fdc0f82e178bc.zip |
Decode full receipt storage
Diffstat (limited to 'core')
-rw-r--r-- | core/transaction_util.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/transaction_util.go b/core/transaction_util.go index cb5d6c7f7..61bf023a6 100644 --- a/core/transaction_util.go +++ b/core/transaction_util.go @@ -55,6 +55,21 @@ func PutReceipts(db common.Database, receipts types.Receipts) error { } // GetReceipt returns a receipt by hash +func GetFullReceipt(db common.Database, txHash common.Hash) *types.ReceiptForStorage { + data, _ := db.Get(append(receiptsPre, txHash[:]...)) + if len(data) == 0 { + return nil + } + + var receipt types.ReceiptForStorage + err := rlp.DecodeBytes(data, &receipt) + if err != nil { + glog.V(logger.Error).Infoln("GetReceipt err:", err) + } + return &receipt +} + +// GetReceipt returns a receipt by hash func GetReceipt(db common.Database, txHash common.Hash) *types.Receipt { data, _ := db.Get(append(receiptsPre, txHash[:]...)) if len(data) == 0 { |