core: update DAO soft-fork number, clean up the code

This commit is contained in:
Péter Szilágyi
2016-06-23 12:47:15 +03:00
parent c4de28938f
commit ba784bdf36
10 changed files with 49 additions and 67 deletions

View File

@ -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
}