mirror of
https://git.wownero.com/wownero/wownero.git
synced 2025-01-08 19:58:52 +00:00
wallet2: request transactions in slices when scanning for known rings
This avoid massive memory consumption for huge wallets
This commit is contained in:
parent
a89545dacf
commit
234296d376
@ -5610,24 +5610,7 @@ bool wallet2::find_and_save_rings(bool force)
|
|||||||
txs_hashes.push_back(txid);
|
txs_hashes.push_back(txid);
|
||||||
}
|
}
|
||||||
|
|
||||||
MDEBUG("Found " << std::to_string(req.txs_hashes.size()) << " transactions");
|
MDEBUG("Found " << std::to_string(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);
|
|
||||||
}
|
|
||||||
THROW_WALLET_EXCEPTION_IF(!r, error::no_connection_to_daemon, "gettransactions");
|
|
||||||
THROW_WALLET_EXCEPTION_IF(res.status == CORE_RPC_STATUS_BUSY, error::daemon_busy, "gettransactions");
|
|
||||||
THROW_WALLET_EXCEPTION_IF(res.status != CORE_RPC_STATUS_OK, error::wallet_internal_error, "gettransactions");
|
|
||||||
THROW_WALLET_EXCEPTION_IF(res.txs.size() != req.txs_hashes.size(), error::wallet_internal_error,
|
|
||||||
"daemon returned wrong response for gettransactions, wrong txs count = " +
|
|
||||||
std::to_string(res.txs.size()) + ", expected " + std::to_string(req.txs_hashes.size()));
|
|
||||||
|
|
||||||
MDEBUG("Scanning " << res.txs.size() << " transactions");
|
|
||||||
|
|
||||||
crypto::chacha_key key;
|
crypto::chacha_key key;
|
||||||
generate_chacha_key_from_secret_keys(key);
|
generate_chacha_key_from_secret_keys(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user