From 70659d3f3550d787036d576162546a4e8b14ad33 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Tue, 10 Sep 2024 15:49:28 -0700 Subject: [PATCH] params: unused code --- params/config.go | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/params/config.go b/params/config.go index 46aaf28239..3e016f2e2d 100644 --- a/params/config.go +++ b/params/config.go @@ -378,32 +378,6 @@ func (c *ChainConfigExtra) CheckCompatible(newcfg_ *ChainConfig, headNumber *big return nil } -// isForkBlockIncompatible returns true if a fork scheduled at block s1 cannot be -// rescheduled to block s2 because head is already past the fork. -func isForkBlockIncompatible(s1, s2, head *big.Int) bool { - return (isBlockForked(s1, head) || isBlockForked(s2, head)) && !configBlockEqual(s1, s2) -} - -// isBlockForked returns whether a fork scheduled at block s is active at the -// given head block. Whilst this method is the same as isTimestampForked, they -// are explicitly separate for clearer reading. -func isBlockForked(s, head *big.Int) bool { - if s == nil || head == nil { - return false - } - return s.Cmp(head) <= 0 -} - -func configBlockEqual(x, y *big.Int) bool { - if x == nil { - return y == nil - } - if y == nil { - return x == nil - } - return x.Cmp(y) == 0 -} - // isForkTimestampIncompatible returns true if a fork scheduled at timestamp s1 // cannot be rescheduled to timestamp s2 because head is already past the fork. func isForkTimestampIncompatible(s1, s2 *uint64, head uint64) bool { @@ -434,28 +408,6 @@ func configTimestampEqual(x, y *uint64) bool { // ChainConfig that would alter the past. type ConfigCompatError = gethparams.ConfigCompatError -func newBlockCompatError(what string, storedblock, newblock *big.Int) *ConfigCompatError { - var rew *big.Int - switch { - case storedblock == nil: - rew = newblock - case newblock == nil || storedblock.Cmp(newblock) < 0: - rew = storedblock - default: - rew = newblock - } - err := &ConfigCompatError{ - What: what, - StoredBlock: storedblock, - NewBlock: newblock, - RewindToBlock: 0, - } - if rew != nil && rew.Sign() > 0 { - err.RewindToBlock = rew.Uint64() - 1 - } - return err -} - func newTimestampCompatError(what string, storedtime, newtime *uint64) *ConfigCompatError { var rew *uint64 switch {