forked from TrueCloudLab/frostfs-node
[#976] innerring: Ignore non-HALT netmap.AddPeer notary invocations
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
93dce149ba
commit
c9f2804885
1 changed files with 13 additions and 0 deletions
|
@ -18,6 +18,19 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
|
||||||
return
|
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
|
// unmarshal node info
|
||||||
nodeInfo := netmap.NewNodeInfo()
|
nodeInfo := netmap.NewNodeInfo()
|
||||||
if err := nodeInfo.Unmarshal(ev.Node()); err != nil {
|
if err := nodeInfo.Unmarshal(ev.Node()); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue