diff --git a/src/protocols/bitcoind/protocol_bitcoind_rest.cpp b/src/protocols/bitcoind/protocol_bitcoind_rest.cpp index 10ea221f..292b85b6 100644 --- a/src/protocols/bitcoind/protocol_bitcoind_rest.cpp +++ b/src/protocols/bitcoind/protocol_bitcoind_rest.cpp @@ -302,7 +302,7 @@ bool protocol_bitcoind_rest::handle_get_block_hash(const code& ec, send_chunk(to_chunk(hash)); return true; case text: - send_text(encode_base16(hash)); + send_text(encode_hash(hash)); return true; case json: send_json(object{ { "blockhash", encode_hash(hash) } }); diff --git a/test/protocols/bitcoind/bitcoind_rest.cpp b/test/protocols/bitcoind/bitcoind_rest.cpp index cbcf4346..db8bf04f 100644 --- a/test/protocols/bitcoind/bitcoind_rest.cpp +++ b/test/protocols/bitcoind/bitcoind_rest.cpp @@ -312,7 +312,7 @@ BC_AUTO_TEST_CASE(bitcoind_rest__blockhashbyheight_bin__height_five__block5) BC_AUTO_TEST_CASE(bitcoind_rest__blockhashbyheight_hex__height_five__block5) { - BC_REQUIRE_EQUAL(rest_text("/rest/blockhashbyheight/5.hex"), encode_base16(test::block5_hash) + "\n"); + BC_REQUIRE_EQUAL(rest_text("/rest/blockhashbyheight/5.hex"), block5 + "\n"); } BC_AUTO_TEST_CASE(bitcoind_rest__blockhashbyheight_above_top__not_found)