Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/protocols/bitcoind/protocol_bitcoind_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ bool protocol_bitcoind_rpc::handle_get_network_info(const code& ec,
// peer-dependent fields (connections, addresses) are reported as empty.
send_result(object_t
{
{ "version", 0 },
// Clients reject a version below 190000 as a legacy daemon.
// TODO: derive the reported bitcoind version from settings.
{ "version", 280000 },
{ "subversion", network_settings().user_agent },
{ "protocolversion", 70016 },

Expand Down
6 changes: 5 additions & 1 deletion test/protocols/bitcoind/bitcoind_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const auto block1 = encode_hash(test::block1_hash);
const auto block5 = encode_hash(test::block5_hash);
const auto block9 = encode_hash(test::block9_hash);

// Typed clients treat a version below this as a legacy daemon.
constexpr int64_t minimum_client_version = 190000;

std::string hash_param(const hash_digest& hash) NOEXCEPT
{
return "[\"" + encode_hash(hash) + "\"]";
Expand Down Expand Up @@ -181,7 +184,8 @@ BOOST_AUTO_TEST_CASE(bitcoind_rpc__getnetworkinfo__fields)
{
const auto response = rpc("getnetworkinfo");
const auto& result = response.at("result");
BOOST_REQUIRE(result.as_object().contains("version"));
BOOST_REQUIRE(result.at("version").is_int64());
BOOST_REQUIRE_GE(result.at("version").as_int64(), minimum_client_version);
BOOST_REQUIRE(result.at("subversion").is_string());
BOOST_REQUIRE(result.as_object().contains("protocolversion"));
BOOST_REQUIRE(result.at("localservices").is_string());
Expand Down
Loading