aboutsummaryrefslogtreecommitdiffstats
path: root/core/block_validator.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-06-23 17:47:15 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-06-23 22:16:43 +0800
commitba784bdf36f2daf7827ec1ec864f3393ba8d86a0 (patch)
tree4fa3104b0e668ba5490d5468a61b58501f56ef79 /core/block_validator.go
parentc4de28938ff8c688c4444c8b3e8e28a52cbc62ff (diff)
downloaddexon-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar
dexon-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.gz
dexon-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.bz2
dexon-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.lz
dexon-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.xz
dexon-ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.tar.zst
dexon-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.go5
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
}