aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-26 18:16:01 +0800
committerobscuren <geffobscura@gmail.com>2015-02-26 19:06:01 +0800
commit49ded3aa7752148ebfbacd4e6ff5f46dc9376f89 (patch)
treeebde269fc7a836b67eb8d7a2a95a90297d8c2435 /core
parent5ab0eaa06d2f5879b9b22778988410bd0c73dcc0 (diff)
parent9884eed0cf7c95074fd5b3d5f0f592a423810a8a (diff)
downloadgo-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar
go-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.gz
go-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.bz2
go-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.lz
go-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.xz
go-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.zst
go-tangerine-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.zip
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Conflicts: accounts/account_manager.go
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index fd591a29d..f66d158b2 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -62,7 +62,7 @@ func NewBlockProcessor(db ethutil.Database, txpool *TxPool, chainManager *ChainM
func (sm *BlockProcessor) TransitionState(statedb *state.StateDB, parent, block *types.Block, transientProcess bool) (receipts types.Receipts, err error) {
coinbase := statedb.GetOrNewStateObject(block.Header().Coinbase)
- coinbase.SetGasPool(CalcGasLimit(parent, block))
+ coinbase.SetGasPool(block.Header().GasLimit)
// Process the transactions on to parent state
receipts, _, _, _, err = sm.ApplyTransactions(coinbase, statedb, block, block.Transactions(), transientProcess)
@@ -247,6 +247,11 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Header().Difficulty, expd)
}
+ expl := CalcGasLimit(parent, block)
+ if expl.Cmp(block.Header().GasLimit) != 0 {
+ return fmt.Errorf("GasLimit check failed for block %v, %v", block.Header().GasLimit, expl)
+ }
+
if block.Time() < parent.Time() {
return ValidationError("Block timestamp not after prev block (%v - %v)", block.Header().Time, parent.Header().Time)
}