Skip to content
Merged
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
24 changes: 12 additions & 12 deletions include/bitcoin/node/protocols/protocol_explore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<system::hash_cptr> hash,
//// std::optional<uint32_t> height) NOEXCEPT;
////

////bool handle_get_block_tx(const code& ec, interface::block_tx,
//// uint8_t version, uint8_t media, uint32_t position,
//// std::optional<system::hash_cptr> hash,
//// std::optional<uint32_t> 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<uint32_t> 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<uint32_t> 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<uint32_t> 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<uint32_t> 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<uint32_t> 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<uint32_t> index) NOEXCEPT;

private:
Expand Down
14 changes: 7 additions & 7 deletions src/full_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down
22 changes: 15 additions & 7 deletions src/protocols/protocol_explore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -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<system::hash_cptr> hash,
uint8_t, uint8_t media, std::optional<hash_cptr> hash,
std::optional<uint32_t> height, bool witness) NOEXCEPT
{
BC_ASSERT(stranded());
Expand All @@ -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{};
Expand All @@ -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<system::hash_cptr> hash,
uint8_t, uint8_t media, std::optional<hash_cptr> hash,
std::optional<uint32_t> height) NOEXCEPT
{
BC_ASSERT(stranded());
Expand All @@ -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{};
Expand All @@ -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());
Expand Down Expand Up @@ -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
Expand Down
Loading