diff --git a/action/protocol/staking/handlers.go b/action/protocol/staking/handlers.go index a465639e9d..2df035ca36 100644 --- a/action/protocol/staking/handlers.go +++ b/action/protocol/staking/handlers.go @@ -682,7 +682,10 @@ func (p *Protocol) handleCandidateRegister(ctx context.Context, act *action.Cand if err := csm.Upsert(c); err != nil { return log, nil, csmErrorToHandleError(owner.String(), err) } - csm.DirtyView().candCenter.base.recordOwner(c) + height, _ := csm.SM().Height() + if p.needToWriteCandsMap(height) { + csm.DirtyView().candCenter.base.recordOwner(c) + } // update bucket pool if err := csm.DebitBucketPool(act.Amount(), true); err != nil { @@ -762,7 +765,10 @@ func (p *Protocol) handleCandidateUpdate(ctx context.Context, act *action.Candid if err := csm.Upsert(c); err != nil { return log, csmErrorToHandleError(c.Owner.String(), err) } - csm.DirtyView().candCenter.base.recordOwner(c) + height, _ := csm.SM().Height() + if p.needToWriteCandsMap(height) { + csm.DirtyView().candCenter.base.recordOwner(c) + } log.AddAddress(actCtx.Caller) return log, nil