lotus/build/isnearupgrade.go
Steven Allen 8fec6e31f2
fix: build: an epoch is near an upgrade iff the upgrade is enabled (#11401)
This isn't a huge deal, but we'd otherwise consider the first finality
epochs (or so) to be "near" any disabled upgrade.
2023-11-29 16:50:05 +04:00

13 lines
253 B
Go

package build
import (
"github.com/filecoin-project/go-state-types/abi"
)
func IsNearUpgrade(epoch, upgradeEpoch abi.ChainEpoch) bool {
if upgradeEpoch < 0 {
return false
}
return epoch > upgradeEpoch-Finality && epoch < upgradeEpoch+Finality
}