core: avoid extra call to GetNextBlockValidatorsInternal

It should be sufficient to retrieve next block validators once per
updateExtensibleWhitelist call and then reuse this value. `nextVals`
copy intentionally omitted since the only change that
smartcontract.CreateDefaultMultiSigRedeemScript performs over the
`nextVals` list is sorting.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-07-03 13:03:10 +03:00
parent 0f2229d6a5
commit 17de1bf7fe

View file

@ -1833,7 +1833,7 @@ func (bc *Blockchain) updateExtensibleWhitelist(height uint32) error {
return err
}
newList = append(newList, hash.Hash160(script))
bc.updateExtensibleList(&newList, bc.contracts.NEO.GetNextBlockValidatorsInternal(bc.dao))
bc.updateExtensibleList(&newList, nextVals)
if len(stateVals) > 0 {
h, err := bc.contracts.Designate.GetLastDesignatedHash(bc.dao, noderoles.StateValidator)