network: optimise NotaryPayload decoding

We have scripts length check during transaction decoding, so don't need
to check it twice.
This commit is contained in:
Anna Shaleva 2021-02-15 17:48:39 +03:00
parent 5569f7ad6c
commit 9a8a19d2f2

View file

@ -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}) {