rpc: allow getting pruned blocks from gettransactions

and get them pruned in find_and_save_rings, since it does not need
the pruned data in the first place.

Also set decode_to_json to false where missing, we don't need this
either.
This commit is contained in:
moneromooo-monero 2018-04-04 10:03:16 +01:00 committed by wowario
parent ab3c7036c3
commit f4d38403a0
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111
2 changed files with 12 additions and 2 deletions

View file

@ -227,7 +227,6 @@ namespace cryptonote
MERROR("Failed to parse and validate tx from blob"); MERROR("Failed to parse and validate tx from blob");
return cryptonote::blobdata(); return cryptonote::blobdata();
} }
return get_pruned_tx_blob(tx); return get_pruned_tx_blob(tx);
} }
//------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------------

View file

@ -5595,7 +5595,18 @@ bool wallet2::find_and_save_rings(bool force)
for (const std::pair<crypto::hash,wallet2::confirmed_transfer_details> &entry: payments) for (const std::pair<crypto::hash,wallet2::confirmed_transfer_details> &entry: payments)
{ {
const crypto::hash &txid = entry.first; const crypto::hash &txid = entry.first;
txs_hashes.push_back(txid); req.txs_hashes.push_back(epee::string_tools::pod_to_hex(txid));
}
MDEBUG("Found " << std::to_string(req.txs_hashes.size()) << " transactions");
// get those transactions from the daemon
req.decode_as_json = false;
req.prune = true;
bool r;
{
const boost::lock_guard<boost::mutex> lock{m_daemon_rpc_mutex};
r = epee::net_utils::invoke_http_json("/gettransactions", req, res, m_http_client, rpc_timeout);
} }
MDEBUG("Found " << std::to_string(txs_hashes.size()) << " transactions"); MDEBUG("Found " << std::to_string(txs_hashes.size()) << " transactions");