diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-06-23 17:47:15 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-23 22:16:43 +0800 |
commit | ba784bdf36f2daf7827ec1ec864f3393ba8d86a0 (patch) | |
tree | 4fa3104b0e668ba5490d5468a61b58501f56ef79 /core/block_validator.go | |
parent | c4de28938ff8c688c4444c8b3e8e28a52cbc62ff (diff) | |
download | go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.gz go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.bz2 go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.lz go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.xz go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.zst go-tangerine-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.zip |
core: update DAO soft-fork number, clean up the code
Diffstat (limited to 'core/block_validator.go')
-rw-r--r-- | core/block_validator.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/block_validator.go b/core/block_validator.go index c3f959324..f056d9e3d 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -371,5 +371,10 @@ func CalcGasLimit(parent *types.Block) *big.Int { gl.Add(parent.GasLimit(), decay) gl.Set(common.BigMin(gl, params.TargetGasLimit)) } + // Temporary special case: if DAO rupture is requested, cap the gas limit + if DAOSoftFork && parent.NumberU64() <= ruptureBlock && gl.Cmp(ruptureTarget) > 0 { + gl.Sub(parent.GasLimit(), decay) + gl.Set(common.BigMax(gl, ruptureTarget)) + } return gl } |