From ba784bdf36f2daf7827ec1ec864f3393ba8d86a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 23 Jun 2016 12:47:15 +0300 Subject: core: update DAO soft-fork number, clean up the code --- core/block_validator.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/block_validator.go') 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 } -- cgit v1.2.3