[#976] innerring: Ignore non-HALT netmap.AddPeer notary invocations

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-11-16 19:20:47 +03:00 committed by Alex Vanin
parent 93dce149ba
commit c9f2804885

View file

@ -18,6 +18,19 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
return
}
// check if notary transaction is valid, see #976
if originalRequest := ev.NotaryRequest(); originalRequest != nil {
tx := originalRequest.MainTransaction
ok, err := np.netmapClient.Morph().IsValidScript(tx.Script, tx.Signers)
if err != nil || !ok {
np.log.Warn("non-halt notary transaction",
zap.String("method", "netmap.AddPeer"),
zap.String("hash", tx.Hash().StringLE()),
zap.Error(err))
return
}
}
// unmarshal node info
nodeInfo := netmap.NewNodeInfo()
if err := nodeInfo.Unmarshal(ev.Node()); err != nil {