Skip to content

Commit 54809f7

Browse files
author
HuangYi
committed
check chain-id
1 parent 6bb630b commit 54809f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/forks.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type Fork struct {
1414
UpgradeName string
1515
// height the upgrade occurs at
1616
UpgradeHeight int64
17+
// chain-id the upgrade occurs at
18+
UpgradeChainId string
1719

1820
// Function that runs some custom state transition code at the beginning of a fork.
1921
BeginForkLogic func(ctx sdk.Context, app *App)
@@ -22,7 +24,7 @@ type Fork struct {
2224
// BeginBlockForks is intended to be ran in a chain upgrade.
2325
func BeginBlockForks(ctx sdk.Context, app *App) {
2426
for _, fork := range Forks {
25-
if ctx.BlockHeight() == fork.UpgradeHeight {
27+
if ctx.BlockHeight() == fork.UpgradeHeight && ctx.ChainID() == fork.UpgradeChainId {
2628
fork.BeginForkLogic(ctx, app)
2729
return
2830
}

0 commit comments

Comments
 (0)