core: properly save votes when processing Account descriptor

They were ignored basically.
This commit is contained in:
Roman Khimov 2020-02-12 18:14:28 +03:00
parent 807309a0de
commit 8310b76d28

View file

@ -713,8 +713,8 @@ func processAccountStateDescriptor(descriptor *transaction.StateDescriptor, dao
if err != nil {
return err
}
account.Votes = votes
if votes.Len() != len(account.Votes) {
account.Votes = votes
for _, vote := range votes {
validator, err := dao.GetValidatorStateOrNew(vote)
if err != nil {
@ -725,6 +725,7 @@ func processAccountStateDescriptor(descriptor *transaction.StateDescriptor, dao
}
}
}
return dao.PutAccountState(account)
}
return nil
}