diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java index b2687ae5e..184a87be8 100644 --- a/core/src/main/java/com/google/bitcoin/core/Peer.java +++ b/core/src/main/java/com/google/bitcoin/core/Peer.java @@ -237,10 +237,17 @@ public class Peer { } private void processAlert(AlertMessage m) { - if (m.isSignatureValid()) { - log.info("Received alert from peer {}: {}", toString(), m.getStatusBar()); - } else { - log.warn("Received alert with invalid signature from peer {}: {}", toString(), m.getStatusBar()); + try { + if (m.isSignatureValid()) { + log.info("Received alert from peer {}: {}", toString(), m.getStatusBar()); + } else { + log.warn("Received alert with invalid signature from peer {}: {}", toString(), m.getStatusBar()); + } + } catch (Throwable t) { + // Signature checking can FAIL on Android platforms before Gingerbread apparently due to bugs in their + // BigInteger implementations! See issue 160 for discussion. As alerts are just optional and not that + // useful, we just swallow the error here. + log.error("Failed to check signature: bug in platform libraries?", t); } }