diff --git a/include/bitcoin/node/protocols/protocol_explore.hpp b/include/bitcoin/node/protocols/protocol_explore.hpp index 902905a9..03120a66 100644 --- a/include/bitcoin/node/protocols/protocol_explore.hpp +++ b/include/bitcoin/node/protocols/protocol_explore.hpp @@ -72,36 +72,36 @@ class BCN_API protocol_explore ////bool handle_get_block_txs(const code& ec, interface::block_txs, //// uint8_t version, uint8_t media, std::optional hash, //// std::optional height) NOEXCEPT; - //// + ////bool handle_get_block_tx(const code& ec, interface::block_tx, //// uint8_t version, uint8_t media, uint32_t position, //// std::optional hash, //// std::optional height, bool witness) NOEXCEPT; - //// + bool handle_get_transaction(const code& ec, interface::transaction, - uint8_t version, uint8_t media, system::hash_cptr hash, + uint8_t version, uint8_t media, const system::hash_cptr& hash, bool witness) NOEXCEPT; ////bool handle_get_address(const code& ec, interface::address, - //// uint8_t version, uint8_t media, system::hash_cptr hash) NOEXCEPT; - //// + //// uint8_t version, uint8_t media, const system::hash_cptr& hash) NOEXCEPT; + ////bool handle_get_input(const code& ec, interface::input, - //// uint8_t version, uint8_t media, system::hash_cptr hash, + //// uint8_t version, uint8_t media, const system::hash_cptr& hash, //// std::optional index) NOEXCEPT; ////bool handle_get_input_script(const code& ec, interface::input_script, - //// uint8_t version, uint8_t media, system::hash_cptr hash, + //// uint8_t version, uint8_t media, const system::hash_cptr& hash, //// std::optional index) NOEXCEPT; ////bool handle_get_input_witness(const code& ec, interface::input_witness, - //// uint8_t version, uint8_t media, system::hash_cptr hash, + //// uint8_t version, uint8_t media, const system::hash_cptr& hash, //// std::optional index) NOEXCEPT; - //// + ////bool handle_get_output(const code& ec, interface::output, - //// uint8_t version, uint8_t media, system::hash_cptr hash, + //// uint8_t version, uint8_t media, const system::hash_cptr& hash, //// std::optional index) NOEXCEPT; ////bool handle_get_output_script(const code& ec, interface::output_script, - //// uint8_t version, uint8_t media, system::hash_cptr hash, + //// uint8_t version, uint8_t media, const system::hash_cptr& hash, //// std::optional index) NOEXCEPT; ////bool handle_get_output_spender(const code& ec, interface::output_spender, - //// uint8_t version, uint8_t media, system::hash_cptr hash, + //// uint8_t version, uint8_t media, const system::hash_cptr& hash, //// std::optional index) NOEXCEPT; private: diff --git a/src/full_node.cpp b/src/full_node.cpp index 5bed9a1b..21e900b0 100644 --- a/src/full_node.cpp +++ b/src/full_node.cpp @@ -121,7 +121,7 @@ void full_node::do_run(const result_handler& handler) NOEXCEPT void full_node::start_web(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { @@ -136,7 +136,7 @@ void full_node::start_web(const code& ec, void full_node::start_explore(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { @@ -151,7 +151,7 @@ void full_node::start_explore(const code& ec, void full_node::start_websocket(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { @@ -166,7 +166,7 @@ void full_node::start_websocket(const code& ec, void full_node::start_bitcoind(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { @@ -181,7 +181,7 @@ void full_node::start_bitcoind(const code& ec, void full_node::start_electrum(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { @@ -196,7 +196,7 @@ void full_node::start_electrum(const code& ec, void full_node::start_stratum_v1(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { @@ -211,7 +211,7 @@ void full_node::start_stratum_v1(const code& ec, void full_node::start_stratum_v2(const code& ec, const result_handler& handler) NOEXCEPT { - BC_ASSERT_MSG(stranded(), "strand"); + BC_ASSERT(stranded()); if (ec) { diff --git a/src/protocols/protocol_explore.cpp b/src/protocols/protocol_explore.cpp index 6041f939..d51ad1ba 100644 --- a/src/protocols/protocol_explore.cpp +++ b/src/protocols/protocol_explore.cpp @@ -39,6 +39,9 @@ using namespace std::placeholders; using object_type = network::rpc::object_t; BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) +BC_PUSH_WARNING(NO_INCOMPLETE_SWITCH) +BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED) +BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR) // Start. // ---------------------------------------------------------------------------- @@ -98,7 +101,7 @@ bool protocol_explore::try_dispatch_object(const request& request) NOEXCEPT // ---------------------------------------------------------------------------- bool protocol_explore::handle_get_block(const code& ec, interface::block, - uint8_t, uint8_t media, std::optional hash, + uint8_t, uint8_t media, std::optional hash, std::optional height, bool witness) NOEXCEPT { BC_ASSERT(stranded()); @@ -107,8 +110,9 @@ bool protocol_explore::handle_get_block(const code& ec, interface::block, return false; const auto& query = archive(); - const auto link = hash.has_value() ? query.to_header(*(hash.value())) : - query.to_confirmed(height.value()); + const auto link = hash.has_value() ? + query.to_header(*(hash.value())) : (height.has_value() ? + query.to_confirmed(height.value()) : database::header_link{}); // TODO: there's no request. const network::http::request request{}; @@ -135,7 +139,7 @@ bool protocol_explore::handle_get_block(const code& ec, interface::block, } bool protocol_explore::handle_get_header(const code& ec, interface::header, - uint8_t, uint8_t media, std::optional hash, + uint8_t, uint8_t media, std::optional hash, std::optional height) NOEXCEPT { BC_ASSERT(stranded()); @@ -144,8 +148,9 @@ bool protocol_explore::handle_get_header(const code& ec, interface::header, return false; const auto& query = archive(); - const auto link = hash.has_value() ? query.to_header(*(hash.value())) : - query.to_confirmed(height.value()); + const auto link = hash.has_value() ? + query.to_header(*(hash.value())) : (height.has_value() ? + query.to_confirmed(height.value()) : database::header_link{}); // TODO: there's no request. const network::http::request request{}; @@ -172,7 +177,7 @@ bool protocol_explore::handle_get_header(const code& ec, interface::header, } bool protocol_explore::handle_get_transaction(const code& ec, - interface::transaction, uint8_t, uint8_t media, system::hash_cptr hash, + interface::transaction, uint8_t, uint8_t media, const hash_cptr& hash, bool witness) NOEXCEPT { BC_ASSERT(stranded()); @@ -206,6 +211,9 @@ bool protocol_explore::handle_get_transaction(const code& ec, return true; } +BC_POP_WARNING() +BC_POP_WARNING() +BC_POP_WARNING() BC_POP_WARNING() #undef SUBSCRIBE_EXPLORE