[staking] save owner list after PersistStakingPatchBlock
@@ -684,7 +684,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)
}
+ 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 {
@@ -764,7 +767,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)
}
+ height, _ := csm.SM().Height()
+ if p.needToWriteCandsMap(height) {
csm.DirtyView().candCenter.base.recordOwner(c)
+ }
log.AddAddress(actCtx.Caller)
return log, nil
