[#971] innerring: Use VUB pointer for initial committee vote

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-11-25 17:52:10 +03:00 committed by Alex Vanin
parent 7f5fb130c0
commit 6f23dbfefe

View file

@ -110,6 +110,7 @@ func (s *Server) voteForSidechainValidator(prm governance.VoteValidatorPrm) erro
var (
nonce uint32 = 1
vub uint32
vubP *uint32
err error
)
@ -118,10 +119,11 @@ func (s *Server) voteForSidechainValidator(prm governance.VoteValidatorPrm) erro
if err != nil {
return fmt.Errorf("could not calculate nonce and `validUntilBlock` values: %w", err)
}
vubP = &vub
}
s.contracts.alphabet.iterate(func(letter GlagoliticLetter, contract util.Uint160) {
err := s.morphClient.NotaryInvoke(contract, s.feeConfig.SideChainFee(), nonce, &vub, voteMethod, int64(epoch), validators)
err := s.morphClient.NotaryInvoke(contract, s.feeConfig.SideChainFee(), nonce, vubP, voteMethod, int64(epoch), validators)
if err != nil {
s.log.Warn("can't invoke vote method in alphabet contract",
zap.Int8("alphabet_index", int8(letter)),