Skip to content

Commit 664ad93

Browse files
committed
Send not implemented for remaining bitcoind rpc methods.
1 parent 38ccaec commit 664ad93

File tree

1 file changed

+45
-25
lines changed

1 file changed

+45
-25
lines changed

src/protocols/protocol_bitcoind_rpc.cpp

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -229,104 +229,124 @@ bool protocol_bitcoind_rpc::handle_get_block(const code& ec,
229229
bool protocol_bitcoind_rpc::handle_get_block_chain_info(const code& ec,
230230
rpc_interface::get_block_chain_info) NOEXCEPT
231231
{
232-
return !ec;
232+
if (stopped(ec)) return false;
233+
send_error(error::not_implemented);
234+
return true;
233235
}
234236

235237
bool protocol_bitcoind_rpc::handle_get_block_count(const code& ec,
236238
rpc_interface::get_block_count) NOEXCEPT
237239
{
238-
return !ec;
240+
if (stopped(ec)) return false;
241+
send_error(error::not_implemented);
242+
return true;
239243
}
240244

241-
// method<"getblockfilter", string_t, optional<"basic"_t>>{ "blockhash", "filtertype" },
242245
bool protocol_bitcoind_rpc::handle_get_block_filter(const code& ec,
243246
rpc_interface::get_block_filter, const std::string&,
244247
const std::string&) NOEXCEPT
245248
{
246-
return !ec;
249+
if (stopped(ec)) return false;
250+
send_error(error::not_implemented);
251+
return true;
247252
}
248253

249-
// method<"getblockhash", number_t>{ "height" },
250254
bool protocol_bitcoind_rpc::handle_get_block_hash(const code& ec,
251255
rpc_interface::get_block_hash, network::rpc::number_t) NOEXCEPT
252256
{
253-
return !ec;
257+
if (stopped(ec)) return false;
258+
send_error(error::not_implemented);
259+
return true;
254260
}
255261

256-
// method<"getblockheader", string_t, optional<true>>{ "blockhash", "verbose" },
257262
bool protocol_bitcoind_rpc::handle_get_block_header(const code& ec,
258263
rpc_interface::get_block_header, const std::string&, bool) NOEXCEPT
259264
{
260-
return !ec;
265+
if (stopped(ec)) return false;
266+
send_error(error::not_implemented);
267+
return true;
261268
}
262269

263-
// method<"getblockstats", string_t, optional<empty::array>>{ "hash_or_height", "stats" },
264270
bool protocol_bitcoind_rpc::handle_get_block_stats(const code& ec,
265271
rpc_interface::get_block_stats, const std::string&,
266272
const network::rpc::array_t&) NOEXCEPT
267273
{
268-
return !ec;
274+
if (stopped(ec)) return false;
275+
send_error(error::not_implemented);
276+
return true;
269277
}
270278

271-
// method<"getchaintxstats", optional<-1_i32>, optional<""_t>>{ "nblocks", "blockhash" },
272279
bool protocol_bitcoind_rpc::handle_get_chain_tx_stats(const code& ec,
273280
rpc_interface::get_chain_tx_stats, double, const std::string&) NOEXCEPT
274281
{
275-
return !ec;
282+
if (stopped(ec)) return false;
283+
send_error(error::not_implemented);
284+
return true;
276285
}
277286

278287
bool protocol_bitcoind_rpc::handle_get_chain_work(const code& ec,
279288
rpc_interface::get_chain_work) NOEXCEPT
280289
{
281-
return !ec;
290+
if (stopped(ec)) return false;
291+
send_error(error::not_implemented);
292+
return true;
282293
}
283294

284-
// method<"gettxout", string_t, number_t, optional<true>>{ "txid", "n", "include_mempool" },
285295
bool protocol_bitcoind_rpc::handle_get_tx_out(const code& ec,
286296
rpc_interface::get_tx_out, const std::string&, double, bool) NOEXCEPT
287297
{
288-
return !ec;
298+
if (stopped(ec)) return false;
299+
send_error(error::not_implemented);
300+
return true;
289301
}
290302

291303
bool protocol_bitcoind_rpc::handle_get_tx_out_set_info(const code& ec,
292304
rpc_interface::get_tx_out_set_info) NOEXCEPT
293305
{
294-
return !ec;
306+
if (stopped(ec)) return false;
307+
send_error(error::not_implemented);
308+
return true;
295309
}
296310

297-
// method<"pruneblockchain", number_t>{ "height" },
298311
bool protocol_bitcoind_rpc::handle_prune_block_chain(const code& ec,
299312
rpc_interface::prune_block_chain, double) NOEXCEPT
300313
{
301-
return !ec;
314+
if (stopped(ec)) return false;
315+
send_error(error::not_implemented);
316+
return true;
302317
}
303318

304319
bool protocol_bitcoind_rpc::handle_save_mem_pool(const code& ec,
305320
rpc_interface::save_mem_pool) NOEXCEPT
306321
{
307-
return !ec;
322+
if (stopped(ec)) return false;
323+
send_error(error::not_implemented);
324+
return true;
308325
}
309326

310-
// method<"scantxoutset", string_t, optional<empty::array>>{ "action", "scanobjects" },
311327
bool protocol_bitcoind_rpc::handle_scan_tx_out_set(const code& ec,
312328
rpc_interface::scan_tx_out_set, const std::string&,
313329
const network::rpc::array_t&) NOEXCEPT
314330
{
315-
return !ec;
331+
if (stopped(ec)) return false;
332+
send_error(error::not_implemented);
333+
return true;
316334
}
317335

318-
// method<"verifychain", optional<4_u32>, optional<288_u32>>{ "checklevel", "nblocks" },
319336
bool protocol_bitcoind_rpc::handle_verify_chain(const code& ec,
320337
rpc_interface::verify_chain, double, double) NOEXCEPT
321338
{
322-
return !ec;
339+
if (stopped(ec)) return false;
340+
send_error(error::not_implemented);
341+
return true;
323342
}
324343

325-
// method<"verifytxoutset", string_t>{ "input_verify_flag" },
326344
bool protocol_bitcoind_rpc::handle_verify_tx_out_set(const code& ec,
327345
rpc_interface::verify_tx_out_set, const std::string&) NOEXCEPT
328346
{
329-
return !ec;
347+
if (stopped(ec)) return false;
348+
send_error(error::not_implemented);
349+
return true;
330350
}
331351

332352
// Senders

0 commit comments

Comments
 (0)