forked from TrueCloudLab/neoneo-go
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:
parent
5569f7ad6c
commit
9a8a19d2f2
1 changed files with 0 additions and 3 deletions
|
@ -142,9 +142,6 @@ func (r *P2PNotaryRequest) isValid() error {
|
||||||
if len(r.FallbackTransaction.Signers) != 2 {
|
if len(r.FallbackTransaction.Signers) != 2 {
|
||||||
return errors.New("fallback transaction should have two signers")
|
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 ||
|
if len(r.FallbackTransaction.Scripts[0].InvocationScript) != 66 ||
|
||||||
len(r.FallbackTransaction.Scripts[0].VerificationScript) != 0 ||
|
len(r.FallbackTransaction.Scripts[0].VerificationScript) != 0 ||
|
||||||
!bytes.HasPrefix(r.FallbackTransaction.Scripts[0].InvocationScript, []byte{byte(opcode.PUSHDATA1), 64}) {
|
!bytes.HasPrefix(r.FallbackTransaction.Scripts[0].InvocationScript, []byte{byte(opcode.PUSHDATA1), 64}) {
|
||||||
|
|
Loading…
Reference in a new issue