From 9a8a19d2f2df610e0676411c172323ffee7e97a9 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 15 Feb 2021 17:48:39 +0300 Subject: [PATCH] network: optimise NotaryPayload decoding We have scripts length check during transaction decoding, so don't need to check it twice. --- pkg/network/payload/notary_request.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/network/payload/notary_request.go b/pkg/network/payload/notary_request.go index 137320fb1..7c4095bc7 100644 --- a/pkg/network/payload/notary_request.go +++ b/pkg/network/payload/notary_request.go @@ -142,9 +142,6 @@ func (r *P2PNotaryRequest) isValid() error { if len(r.FallbackTransaction.Signers) != 2 { return errors.New("fallback transaction should have two signers") } - if len(r.FallbackTransaction.Scripts) != 2 { - return errors.New("fallback transaction should have dummy Notary witness and valid witness for the second signer") - } if len(r.FallbackTransaction.Scripts[0].InvocationScript) != 66 || len(r.FallbackTransaction.Scripts[0].VerificationScript) != 0 || !bytes.HasPrefix(r.FallbackTransaction.Scripts[0].InvocationScript, []byte{byte(opcode.PUSHDATA1), 64}) {