diff --git a/action/protocol/context.go b/action/protocol/context.go index 7c27137b42..62f5cd3246 100644 --- a/action/protocol/context.go +++ b/action/protocol/context.go @@ -109,6 +109,7 @@ type ( FixGasAndNonceUpdate bool FixUnproductiveDelegates bool CorrectGasRefund bool + FixRewardErroCheckPosition bool } // FeatureWithHeightCtx provides feature check functions. @@ -243,6 +244,7 @@ func WithFeatureCtx(ctx context.Context) context.Context { FixGasAndNonceUpdate: g.IsOkhotsk(height), FixUnproductiveDelegates: g.IsOkhotsk(height), CorrectGasRefund: g.IsOkhotsk(height), + FixRewardErroCheckPosition: g.IsOkhotsk(height), }, ) } diff --git a/action/protocol/rewarding/reward.go b/action/protocol/rewarding/reward.go index 2e22bbcd87..61e785c211 100644 --- a/action/protocol/rewarding/reward.go +++ b/action/protocol/rewarding/reward.go @@ -98,6 +98,12 @@ func (p *Protocol) GrantBlockReward( return nil, nil } rewardAddr, err := address.FromString(rewardAddrStr) + fCtx := protocol.MustGetFeatureCtx(ctx) + if fCtx.FixRewardErroCheckPosition { + if err != nil { + return nil, err + } + } a := admin{} if _, err := p.state(ctx, sm, _adminKey, &a); err != nil { @@ -106,8 +112,10 @@ func (p *Protocol) GrantBlockReward( if err := p.updateAvailableBalance(ctx, sm, a.blockReward); err != nil { return nil, err } - if err != nil { - return nil, err + if !fCtx.FixRewardErroCheckPosition { + if err != nil { + return nil, err + } } if err := p.grantToAccount(ctx, sm, rewardAddr, a.blockReward); err != nil { return nil, err