diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-16 15:06:02 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:53 +0800 |
commit | dfd3d209ddb5c48ced410eb543ee9b17cffc575e (patch) | |
tree | 5e61fb16791bf5c3c3ed93f7594b34dca1b5e6af /core/blockchain.go | |
parent | dc83d93d6dbd9d73880e6e4b32931e1ea8e36219 (diff) | |
download | dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.tar dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.tar.gz dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.tar.bz2 dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.tar.lz dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.tar.xz dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.tar.zst dexon-dfd3d209ddb5c48ced410eb543ee9b17cffc575e.zip |
core: revert changes to StateProcessor.Process (#29)
Diffstat (limited to 'core/blockchain.go')
-rw-r--r-- | core/blockchain.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index c364e57d2..344a032a1 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1569,6 +1569,13 @@ func (bc *BlockChain) processPendingBlock( currentBlock := bc.CurrentBlock() + var ( + receipts types.Receipts + usedGas = new(uint64) + header = block.Header() + gp = new(GasPool).AddGas(math.MaxUint64) + ) + var parentBlock *types.Block var pendingState *state.StateDB var err error @@ -1581,18 +1588,13 @@ func (bc *BlockChain) processPendingBlock( } else { parentBlock = parent.block } - block.RawHeader().ParentHash = parentBlock.Hash() + + header.ParentHash = parentBlock.Hash() pendingState, err = state.New(parentBlock.Root(), bc.stateCache) if err != nil { return nil, nil, nil, err } - var ( - receipts types.Receipts - usedGas = new(uint64) - header = block.Header() - gp = new(GasPool).AddGas(math.MaxUint64) - ) // Iterate over and process the individual transactions for i, tx := range block.Transactions() { pendingState.Prepare(tx.Hash(), block.Hash(), i) |