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 Apr 6, 2022
1 parent a0fcdb1 commit a987d17
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ bin/
out/
*.chain
*.spvchain
.DS_Store
Binary file removed core/.DS_Store
Binary file not shown.
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 a987d17

Please sign in to comment.