Skip to content

Commit

Permalink
Unsubsribe chain head if it's a block over kaia fork
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonLewis committed May 15, 2024
1 parent 06dee72 commit 8f06417
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion reward/staking_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,12 @@ func handleChainHeadEvent() {
}
if pset.Policy() == params.WeightedRandom {
// check and update if staking info is not valid before for the next update interval blocks
stakingInfo := GetStakingInfo(ev.Block.NumberU64() + pset.StakeUpdateInterval())
targetBlock := ev.Block.NumberU64() + pset.StakeUpdateInterval()
// After kaia fork, do not need to check staking info for the next update interval blocks.
if isKaiaForkEnabled(targetBlock) {
break
}
stakingInfo := GetStakingInfo(targetBlock)
if stakingInfo == nil {
logger.Error("unable to fetch staking info", "blockNum", ev.Block.NumberU64())
}
Expand Down

0 comments on commit 8f06417

Please sign in to comment.