From 17de1bf7fe6717f96aebf2f601304f77a6d26c47 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 3 Jul 2024 13:03:10 +0300 Subject: [PATCH] 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 --- pkg/core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 3e7984aa7..d272ffa5e 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -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)