From 90638a25ac47316f3003e456cc397ddbe68ad13e Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 18 Jun 2017 14:14:30 +0800 Subject: [PATCH] get_alt_blocks modified --- src/page.h | 10 +++++----- src/rpccalls.cpp | 10 +++++----- src/rpccalls.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/page.h b/src/page.h index 55cf23a..83a6c08 100644 --- a/src/page.h +++ b/src/page.h @@ -425,15 +425,15 @@ namespace xmreg {"show_cache_times" , show_cache_times} }; - vector atl_blks; + vector atl_blks_hashes; - rpc.get_alt_blocks(atl_blks); + rpc.get_alt_blocks(atl_blks_hashes); - cout << "atl_blks.size(): " << atl_blks.size() << endl; + cout << "atl_blks_hashes.size(): " << atl_blks_hashes.size() << endl; - for (const block_complete_entry& alt_blk: atl_blks) + for (const string& alt_blk_hash: atl_blks_hashes) { - cout << "alt_blk tx: " << alt_blk.txs.size() << endl; + cout << "alt_blk_hash: " << alt_blk_hash << endl; } context.emplace("txs", mstch::array()); // will keep tx to show diff --git a/src/rpccalls.cpp b/src/rpccalls.cpp index cd34f7c..8f522f8 100644 --- a/src/rpccalls.cpp +++ b/src/rpccalls.cpp @@ -209,12 +209,12 @@ rpccalls::get_network_info(COMMAND_RPC_GET_INFO::response& response) } bool -rpccalls::get_alt_blocks(vector& alt_blocks) +rpccalls::get_alt_blocks(vector& alt_blocks_hashes) { bool r {false}; - COMMAND_RPC_GET_ALT_BLOCKS::request req; - COMMAND_RPC_GET_ALT_BLOCKS::response resp; + COMMAND_RPC_GET_ALT_BLOCKS_HASHES::request req; + COMMAND_RPC_GET_ALT_BLOCKS_HASHES::response resp; { std::lock_guard guard(m_daemon_rpc_mutex); @@ -225,7 +225,7 @@ rpccalls::get_alt_blocks(vector& alt_blocks) return false; } - r = epee::net_utils::invoke_http_bin("/getaltblocks.bin", + r = epee::net_utils::invoke_http_json("/get_alt_blocks_hashes", req, resp, m_http_client); } @@ -257,7 +257,7 @@ rpccalls::get_alt_blocks(vector& alt_blocks) return false; } - alt_blocks = resp.blocks; + alt_blocks_hashes = resp.blks_hashes; return true; } diff --git a/src/rpccalls.h b/src/rpccalls.h index f33c01c..560d9c4 100644 --- a/src/rpccalls.h +++ b/src/rpccalls.h @@ -53,7 +53,7 @@ public: get_network_info(COMMAND_RPC_GET_INFO::response& info); bool - get_alt_blocks(vector& alt_blocks); + get_alt_blocks(vector& alt_blocks_hashes); bool get_dynamic_per_kb_fee_estimate(