From 9b8e1cfb04aa100cb356baf5c671a610f58ff338 Mon Sep 17 00:00:00 2001 From: Kevin Abramczyk Date: Mon, 11 May 2026 12:03:19 -0400 Subject: [PATCH 1/2] fix return hash_function prior v1.7 --- src/protocols/electrum/protocol_electrum_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocols/electrum/protocol_electrum_server.cpp b/src/protocols/electrum/protocol_electrum_server.cpp index 5ae4f9f9..1d7495be 100644 --- a/src/protocols/electrum/protocol_electrum_server.cpp +++ b/src/protocols/electrum/protocol_electrum_server.cpp @@ -118,7 +118,7 @@ void protocol_electrum::handle_server_features(const code& ec, { "pruning", null_t{} } }; - if (!at_least(electrum::version::v1_6)) + if (!at_least(electrum::version::v1_7)) { value["hash_function"] = string_t{ "sha256" }; } From ee729405dba02d6604cfce084db4521c05a914f0 Mon Sep 17 00:00:00 2001 From: Kevin Abramczyk Date: Mon, 11 May 2026 14:04:09 -0400 Subject: [PATCH 2/2] adapt test handle_serverfeatures --- test/protocols/electrum/electrum_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/protocols/electrum/electrum_server.cpp b/test/protocols/electrum/electrum_server.cpp index 8a31bfa1..d48536d5 100644 --- a/test/protocols/electrum/electrum_server.cpp +++ b/test/protocols/electrum/electrum_server.cpp @@ -167,9 +167,9 @@ BOOST_AUTO_TEST_CASE(electrum__server_features__default_hosts__expected) REQUIRE_NO_THROW_TRUE(host.at("ssl_port").is_null()); } -BOOST_AUTO_TEST_CASE(electrum__server_features__v1_6__hash_function_removed) +BOOST_AUTO_TEST_CASE(electrum__server_features__v1_7__hash_function_removed) { - BOOST_REQUIRE(handshake(electrum::version::v1_6)); + BOOST_REQUIRE(handshake(electrum::version::v1_7)); const auto response = get(R"({"id":300,"method":"server.features","params":[]})" "\n"); REQUIRE_NO_THROW_TRUE(response.at("result").is_object());