mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-02-01 23:40:35 +00:00
notary: simplify key presence check with slices
Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
8925b42250
commit
c07604fbf3
1 changed files with 4 additions and 6 deletions
|
@ -1,6 +1,8 @@
|
|||
package notary
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
|
@ -13,12 +15,8 @@ func (n *Notary) UpdateNotaryNodes(notaryNodes keys.PublicKeys) {
|
|||
n.accMtx.Lock()
|
||||
defer n.accMtx.Unlock()
|
||||
|
||||
if n.currAccount != nil {
|
||||
for _, node := range notaryNodes {
|
||||
if node.Equal(n.currAccount.PublicKey()) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if n.currAccount != nil && slices.ContainsFunc(notaryNodes, n.currAccount.PublicKey().Equal) {
|
||||
return
|
||||
}
|
||||
|
||||
var acc *wallet.Account
|
||||
|
|
Loading…
Add table
Reference in a new issue