77import org .arkecosystem .crypto .identities .PrivateKey ;
88import org .bitcoinj .core .ECKey ;
99import org .bitcoinj .core .Sha256Hash ;
10+ import org .bitcoinj .core .SignatureDecodeException ;
1011
1112import java .lang .reflect .Type ;
1213import java .nio .ByteBuffer ;
@@ -66,7 +67,11 @@ public boolean verify() {
6667 byte [] signature = Hex .decode (this .signature );
6768 byte [] bytes = toBytes ();
6869
69- return ECKey .verify (Sha256Hash .hash (bytes ), signature , keys .getPubKey ());
70+ try {
71+ return ECKey .verify (Sha256Hash .hash (bytes ), signature , keys .getPubKey ());
72+ } catch (SignatureDecodeException e ) {
73+ return false ;
74+ }
7075 }
7176
7277 public boolean secondVerify (String secondPublicKey ) {
@@ -75,7 +80,11 @@ public boolean secondVerify(String secondPublicKey) {
7580 byte [] signature = Hex .decode (this .signSignature );
7681 byte [] bytes = toBytes (false );
7782
78- return ECKey .verify (Sha256Hash .hash (bytes ), signature , keys .getPubKey ());
83+ try {
84+ return ECKey .verify (Sha256Hash .hash (bytes ), signature , keys .getPubKey ());
85+ } catch (SignatureDecodeException e ) {
86+ return false ;
87+ }
7988 }
8089
8190 public Transaction parseSignatures (String serialized , int startOffset ) {
0 commit comments