Skip to content

Commit

Permalink
Added try/catch as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Mar 31, 2022
1 parent a0fcdb1 commit 73bddc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/org/bitcoinj/core/ECKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,12 @@ public static boolean verify(byte[] data, ECDSASignature signature, byte[] pub)
*/
public static boolean verify(byte[] data, byte[] signature, byte[] pub) throws SignatureDecodeException {
if (Secp256k1Context.isEnabled()) {
return NativeSecp256k1.verify(data, signature, pub);
try {
return NativeSecp256k1.verify(data, signature, pub);
} catch (Exception e) {
log.error("Caught Exception inside secp256k1", e);
return false;
}
}
return verify(data, ECDSASignature.decodeFromDER(signature), pub);
}
Expand Down

0 comments on commit 73bddc8

Please sign in to comment.