From 31f9cca33ac0ec4e5a035439dabac02d84b6b049 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 27 Sep 2021 08:15:20 +0200 Subject: [PATCH] handle electrs batching detection better --- .../java/com/sparrowwallet/sparrow/net/ElectrumServer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java b/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java index 5e55ee0f..4019ee94 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/ElectrumServer.java @@ -891,6 +891,10 @@ public class ElectrumServer { if(server.startsWith("electrs/")) { String electrsVersion = server.substring("electrs/".length()); + int dashIndex = electrsVersion.indexOf('-'); + if(dashIndex > -1) { + electrsVersion = electrsVersion.substring(0, dashIndex); + } try { Version version = new Version(electrsVersion); if(version.compareTo(ELECTRS_MIN_BATCHING_VERSION) >= 0) {