aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-16 15:06:02 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commit652ec743c6e05a94212745daec4c10565e57524b (patch)
treeaaf71326d6243862a72b6fd3764c721c6c74561e
parent7309a991020a78dd389dd851b9b496d6bdf928bb (diff)
downloadgo-tangerine-652ec743c6e05a94212745daec4c10565e57524b.tar
go-tangerine-652ec743c6e05a94212745daec4c10565e57524b.tar.gz
go-tangerine-652ec743c6e05a94212745daec4c10565e57524b.tar.bz2
go-tangerine-652ec743c6e05a94212745daec4c10565e57524b.tar.lz
go-tangerine-652ec743c6e05a94212745daec4c10565e57524b.tar.xz
go-tangerine-652ec743c6e05a94212745daec4c10565e57524b.tar.zst
go-tangerine-652ec743c6e05a94212745daec4c10565e57524b.zip
core: revert changes to StateProcessor.Process (#29)
-rw-r--r--core/blockchain.go16
-rw-r--r--core/types/block.go4
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} }