diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-09-30 00:36:16 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-10-19 15:03:09 +0800 |
commit | 42c8afd44006b170c20159abaadc31cc7545bec2 (patch) | |
tree | 49f150caef8b09d1584dc9635382b3938fee45e1 /core/transaction_util.go | |
parent | b99fe27f8b4d37fe3838d52b682e99c85098ee59 (diff) | |
download | go-tangerine-42c8afd44006b170c20159abaadc31cc7545bec2.tar.gz go-tangerine-42c8afd44006b170c20159abaadc31cc7545bec2.tar.zst go-tangerine-42c8afd44006b170c20159abaadc31cc7545bec2.zip |
core: differentiate receipt concensus and storage decoding
Diffstat (limited to 'core/transaction_util.go')
-rw-r--r-- | core/transaction_util.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/transaction_util.go b/core/transaction_util.go index 9a82ec4dc..dbda4cfe7 100644 --- a/core/transaction_util.go +++ b/core/transaction_util.go @@ -140,12 +140,16 @@ func GetBlockReceipts(db ethdb.Database, hash common.Hash) types.Receipts { if len(data) == 0 { return nil } - receipts := new(types.Receipts) - if err := rlp.DecodeBytes(data, receipts); err != nil { + rs := []*types.ReceiptForStorage{} + if err := rlp.DecodeBytes(data, &rs); err != nil { glog.V(logger.Error).Infof("invalid receipt array RLP for hash %x: %v", hash, err) return nil } - return *receipts + receipts := make(types.Receipts, len(rs)) + for i, receipt := range rs { + receipts[i] = (*types.Receipt)(receipt) + } + return receipts } // PutBlockReceipts stores the block's transactions associated receipts |