diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-05-29 17:56:26 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-05-29 17:56:26 -0500 |
commit | c534fe8d19aa20a30849ca123f0bd90314659970 (patch) | |
tree | aa2de98502f7046acb171ed10caef311d464bdf4 /src/rpc | |
parent | Merge pull request #3477 (diff) | |
parent | db_lmdb: save pruned and prunable tx data separately (diff) | |
download | monero-c534fe8d19aa20a30849ca123f0bd90314659970.tar.xz |
Merge pull request #3251
b9389e5 db_lmdb: save pruned and prunable tx data separately (moneromooo-monero)
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 19 | ||||
-rw-r--r-- | src/rpc/daemon_handler.cpp | 2 |
2 files changed, 3 insertions, 18 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index e28914d96..b5ef2557a 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -219,18 +219,6 @@ namespace cryptonote return ss.str(); } //------------------------------------------------------------------------------------------------------------------------------ - static cryptonote::blobdata get_pruned_tx_blob(const cryptonote::blobdata &blobdata) - { - cryptonote::transaction tx; - - if (!cryptonote::parse_and_validate_tx_from_blob(blobdata, tx)) - { - MERROR("Failed to parse and validate tx from blob"); - return cryptonote::blobdata(); - } - return get_pruned_tx_blob(tx); - } - //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::on_get_blocks(const COMMAND_RPC_GET_BLOCKS_FAST::request& req, COMMAND_RPC_GET_BLOCKS_FAST::response& res) { PERF_TIMER(on_get_blocks); @@ -240,7 +228,7 @@ namespace cryptonote std::list<std::pair<cryptonote::blobdata, std::list<cryptonote::blobdata> > > bs; - if(!m_core.find_blockchain_supplement(req.start_height, req.block_ids, bs, res.current_height, res.start_height, COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT)) + if(!m_core.find_blockchain_supplement(req.start_height, req.block_ids, bs, res.current_height, res.start_height, req.prune, COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT)) { res.status = "Failed"; return false; @@ -272,10 +260,7 @@ namespace cryptonote for (std::list<cryptonote::blobdata>::iterator i = bd.second.begin(); i != bd.second.end(); ++i) { unpruned_size += i->size(); - if (req.prune) - res.blocks.back().txs.push_back(get_pruned_tx_blob(std::move(*i))); - else - res.blocks.back().txs.push_back(std::move(*i)); + res.blocks.back().txs.push_back(std::move(*i)); i->clear(); i->shrink_to_fit(); pruned_size += res.blocks.back().txs.back().size(); diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp index 29020aa57..39f169cdf 100644 --- a/src/rpc/daemon_handler.cpp +++ b/src/rpc/daemon_handler.cpp @@ -52,7 +52,7 @@ namespace rpc { std::list<std::pair<blobdata, std::list<blobdata> > > blocks; - if(!m_core.find_blockchain_supplement(req.start_height, req.block_ids, blocks, res.current_height, res.start_height, COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT)) + if(!m_core.find_blockchain_supplement(req.start_height, req.block_ids, blocks, res.current_height, res.start_height, req.prune, COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT)) { res.status = Message::STATUS_FAILED; res.error_details = "core::find_blockchain_supplement() returned false"; |