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 | |
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')
-rw-r--r-- | core/blockchain.go | 16 | ||||
-rw-r--r-- | core/types/block.go | 4 |
2 files changed, 10 insertions, 10 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) diff --git a/core/types/block.go b/core/types/block.go index 8947c3a17..3766d3ac0 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -315,9 +315,7 @@ func (b *Block) Randomness() []byte { return common.CopyBytes(b.header.Ran func (b *Block) Reward() *big.Int { return new(big.Int).Set(b.header.Reward) } func (b *Block) Round() uint64 { return b.header.Round } func (b *Block) DexconMeta() []byte { return common.CopyBytes(b.header.DexconMeta) } - -func (b *Block) Header() *Header { return CopyHeader(b.header) } -func (b *Block) RawHeader() *Header { return b.header } +func (b *Block) Header() *Header { return CopyHeader(b.header) } // Body returns the non-header content of the block. func (b *Block) Body() *Body { return &Body{b.transactions, b.uncles} } |