aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-18 19:21:40 +0800
committerobscuren <geffobscura@gmail.com>2014-07-18 19:21:40 +0800
commitcd9b344506ee2daeb7a6248b2cdb5e7e69db7e79 (patch)
treefb6f14e9dc00e00dc08a03da1e6928153d1d37e9 /ethchain
parent61cc2ba7d960b2e82886223b78190d552529cb12 (diff)
downloadgo-tangerine-cd9b344506ee2daeb7a6248b2cdb5e7e69db7e79.tar.gz
go-tangerine-cd9b344506ee2daeb7a6248b2cdb5e7e69db7e79.tar.zst
go-tangerine-cd9b344506ee2daeb7a6248b2cdb5e7e69db7e79.zip
Fixed range
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/state_manager.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go
index 0d4b8ac55..a12ce53e5 100644
--- a/ethchain/state_manager.go
+++ b/ethchain/state_manager.go
@@ -151,9 +151,11 @@ done:
accumelative := new(big.Int).Set(totalUsedGas.Add(totalUsedGas, txGas))
receipt := &Receipt{tx, ethutil.CopyBytes(state.Root().([]byte)), accumelative}
- original := block.Receipts()[i]
- if !original.Cmp(receipt) {
- return nil, nil, nil, fmt.Errorf("err diff #%d (r) %v ~ %x <=> (c) %v ~ %x (%x)\n", i+1, original.CumulativeGasUsed, original.PostState[0:4], receipt.CumulativeGasUsed, receipt.PostState[0:4], receipt.Tx.Hash())
+ if i < len(block.Receipts()) {
+ original := block.Receipts()[i]
+ if !original.Cmp(receipt) {
+ return nil, nil, nil, fmt.Errorf("err diff #%d (r) %v ~ %x <=> (c) %v ~ %x (%x)\n", i+1, original.CumulativeGasUsed, original.PostState[0:4], receipt.CumulativeGasUsed, receipt.PostState[0:4], receipt.Tx.Hash())
+ }
}
receipts = append(receipts, receipt)