[#225] netmap: Do not emit some events in notary-enabled mode

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-17 16:02:56 +03:00 committed by Alex Vanin
parent a4f9d52cfc
commit f6766a144f
2 changed files with 9 additions and 16 deletions

View file

@ -233,7 +233,9 @@ func AddPeer(nodeInfo []byte) {
publicKey := nodeInfo[2:35] // offset:2, len:33
common.CheckWitness(publicKey)
runtime.Notify("AddPeer", nodeInfo)
if notaryDisabled {
runtime.Notify("AddPeer", nodeInfo)
}
return
}
@ -287,7 +289,9 @@ func UpdateState(state int, publicKey interop.PublicKey) {
// just emit the notification for alphabet.
if !notaryDisabled || len(nodeKey) == 0 {
common.CheckWitness(publicKey)
runtime.Notify("UpdateState", state, publicKey)
if notaryDisabled {
runtime.Notify("UpdateState", state, publicKey)
}
return
}