Skip to content

Commit dc0d60d

Browse files
authored
Merge pull request #895 from evoskuil/master
Style, delint.
2 parents 82a9d92 + 1bd12b8 commit dc0d60d

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

include/bitcoin/node/protocols/protocol_explore.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,36 +72,36 @@ class BCN_API protocol_explore
7272
////bool handle_get_block_txs(const code& ec, interface::block_txs,
7373
//// uint8_t version, uint8_t media, std::optional<system::hash_cptr> hash,
7474
//// std::optional<uint32_t> height) NOEXCEPT;
75-
////
75+
7676
////bool handle_get_block_tx(const code& ec, interface::block_tx,
7777
//// uint8_t version, uint8_t media, uint32_t position,
7878
//// std::optional<system::hash_cptr> hash,
7979
//// std::optional<uint32_t> height, bool witness) NOEXCEPT;
80-
////
80+
8181
bool handle_get_transaction(const code& ec, interface::transaction,
82-
uint8_t version, uint8_t media, system::hash_cptr hash,
82+
uint8_t version, uint8_t media, const system::hash_cptr& hash,
8383
bool witness) NOEXCEPT;
8484
////bool handle_get_address(const code& ec, interface::address,
85-
//// uint8_t version, uint8_t media, system::hash_cptr hash) NOEXCEPT;
86-
////
85+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash) NOEXCEPT;
86+
8787
////bool handle_get_input(const code& ec, interface::input,
88-
//// uint8_t version, uint8_t media, system::hash_cptr hash,
88+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash,
8989
//// std::optional<uint32_t> index) NOEXCEPT;
9090
////bool handle_get_input_script(const code& ec, interface::input_script,
91-
//// uint8_t version, uint8_t media, system::hash_cptr hash,
91+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash,
9292
//// std::optional<uint32_t> index) NOEXCEPT;
9393
////bool handle_get_input_witness(const code& ec, interface::input_witness,
94-
//// uint8_t version, uint8_t media, system::hash_cptr hash,
94+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash,
9595
//// std::optional<uint32_t> index) NOEXCEPT;
96-
////
96+
9797
////bool handle_get_output(const code& ec, interface::output,
98-
//// uint8_t version, uint8_t media, system::hash_cptr hash,
98+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash,
9999
//// std::optional<uint32_t> index) NOEXCEPT;
100100
////bool handle_get_output_script(const code& ec, interface::output_script,
101-
//// uint8_t version, uint8_t media, system::hash_cptr hash,
101+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash,
102102
//// std::optional<uint32_t> index) NOEXCEPT;
103103
////bool handle_get_output_spender(const code& ec, interface::output_spender,
104-
//// uint8_t version, uint8_t media, system::hash_cptr hash,
104+
//// uint8_t version, uint8_t media, const system::hash_cptr& hash,
105105
//// std::optional<uint32_t> index) NOEXCEPT;
106106

107107
private:

src/full_node.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void full_node::do_run(const result_handler& handler) NOEXCEPT
121121
void full_node::start_web(const code& ec,
122122
const result_handler& handler) NOEXCEPT
123123
{
124-
BC_ASSERT_MSG(stranded(), "strand");
124+
BC_ASSERT(stranded());
125125

126126
if (ec)
127127
{
@@ -136,7 +136,7 @@ void full_node::start_web(const code& ec,
136136
void full_node::start_explore(const code& ec,
137137
const result_handler& handler) NOEXCEPT
138138
{
139-
BC_ASSERT_MSG(stranded(), "strand");
139+
BC_ASSERT(stranded());
140140

141141
if (ec)
142142
{
@@ -151,7 +151,7 @@ void full_node::start_explore(const code& ec,
151151
void full_node::start_websocket(const code& ec,
152152
const result_handler& handler) NOEXCEPT
153153
{
154-
BC_ASSERT_MSG(stranded(), "strand");
154+
BC_ASSERT(stranded());
155155

156156
if (ec)
157157
{
@@ -166,7 +166,7 @@ void full_node::start_websocket(const code& ec,
166166
void full_node::start_bitcoind(const code& ec,
167167
const result_handler& handler) NOEXCEPT
168168
{
169-
BC_ASSERT_MSG(stranded(), "strand");
169+
BC_ASSERT(stranded());
170170

171171
if (ec)
172172
{
@@ -181,7 +181,7 @@ void full_node::start_bitcoind(const code& ec,
181181
void full_node::start_electrum(const code& ec,
182182
const result_handler& handler) NOEXCEPT
183183
{
184-
BC_ASSERT_MSG(stranded(), "strand");
184+
BC_ASSERT(stranded());
185185

186186
if (ec)
187187
{
@@ -196,7 +196,7 @@ void full_node::start_electrum(const code& ec,
196196
void full_node::start_stratum_v1(const code& ec,
197197
const result_handler& handler) NOEXCEPT
198198
{
199-
BC_ASSERT_MSG(stranded(), "strand");
199+
BC_ASSERT(stranded());
200200

201201
if (ec)
202202
{
@@ -211,7 +211,7 @@ void full_node::start_stratum_v1(const code& ec,
211211
void full_node::start_stratum_v2(const code& ec,
212212
const result_handler& handler) NOEXCEPT
213213
{
214-
BC_ASSERT_MSG(stranded(), "strand");
214+
BC_ASSERT(stranded());
215215

216216
if (ec)
217217
{

src/protocols/protocol_explore.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ using namespace std::placeholders;
3939
using object_type = network::rpc::object_t;
4040

4141
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
42+
BC_PUSH_WARNING(NO_INCOMPLETE_SWITCH)
43+
BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED)
44+
BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR)
4245

4346
// Start.
4447
// ----------------------------------------------------------------------------
@@ -98,7 +101,7 @@ bool protocol_explore::try_dispatch_object(const request& request) NOEXCEPT
98101
// ----------------------------------------------------------------------------
99102

100103
bool protocol_explore::handle_get_block(const code& ec, interface::block,
101-
uint8_t, uint8_t media, std::optional<system::hash_cptr> hash,
104+
uint8_t, uint8_t media, std::optional<hash_cptr> hash,
102105
std::optional<uint32_t> height, bool witness) NOEXCEPT
103106
{
104107
BC_ASSERT(stranded());
@@ -107,8 +110,9 @@ bool protocol_explore::handle_get_block(const code& ec, interface::block,
107110
return false;
108111

109112
const auto& query = archive();
110-
const auto link = hash.has_value() ? query.to_header(*(hash.value())) :
111-
query.to_confirmed(height.value());
113+
const auto link = hash.has_value() ?
114+
query.to_header(*(hash.value())) : (height.has_value() ?
115+
query.to_confirmed(height.value()) : database::header_link{});
112116

113117
// TODO: there's no request.
114118
const network::http::request request{};
@@ -135,7 +139,7 @@ bool protocol_explore::handle_get_block(const code& ec, interface::block,
135139
}
136140

137141
bool protocol_explore::handle_get_header(const code& ec, interface::header,
138-
uint8_t, uint8_t media, std::optional<system::hash_cptr> hash,
142+
uint8_t, uint8_t media, std::optional<hash_cptr> hash,
139143
std::optional<uint32_t> height) NOEXCEPT
140144
{
141145
BC_ASSERT(stranded());
@@ -144,8 +148,9 @@ bool protocol_explore::handle_get_header(const code& ec, interface::header,
144148
return false;
145149

146150
const auto& query = archive();
147-
const auto link = hash.has_value() ? query.to_header(*(hash.value())) :
148-
query.to_confirmed(height.value());
151+
const auto link = hash.has_value() ?
152+
query.to_header(*(hash.value())) : (height.has_value() ?
153+
query.to_confirmed(height.value()) : database::header_link{});
149154

150155
// TODO: there's no request.
151156
const network::http::request request{};
@@ -172,7 +177,7 @@ bool protocol_explore::handle_get_header(const code& ec, interface::header,
172177
}
173178

174179
bool protocol_explore::handle_get_transaction(const code& ec,
175-
interface::transaction, uint8_t, uint8_t media, system::hash_cptr hash,
180+
interface::transaction, uint8_t, uint8_t media, const hash_cptr& hash,
176181
bool witness) NOEXCEPT
177182
{
178183
BC_ASSERT(stranded());
@@ -206,6 +211,9 @@ bool protocol_explore::handle_get_transaction(const code& ec,
206211
return true;
207212
}
208213

214+
BC_POP_WARNING()
215+
BC_POP_WARNING()
216+
BC_POP_WARNING()
209217
BC_POP_WARNING()
210218

211219
#undef SUBSCRIBE_EXPLORE

0 commit comments

Comments
 (0)