aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorj-berman <justinberman@protonmail.com>2022-12-13 16:08:56 -0800
committerrbrunner7 <rbrunner@dreamshare.ch>2023-07-09 08:38:18 +0200
commitf137a35984985232a3aae50cd4c7b47634866594 (patch)
tree8a111f52314d13d6d1132c905392e4c377749244 /src/wallet/wallet_rpc_server.cpp
parentwallet2, RPC: Optimize RPC calls for periodic refresh from 3 down to 1 call [... (diff)
downloadmonero-f137a35984985232a3aae50cd4c7b47634866594.tar.xz
Enforce restricted # pool txs served via RPC + optimize chunked reqs [release-v0.18]
- `/getblocks.bin` respects the `RESTRICTED_TX_COUNT` (=100) when returning pool txs via a restricted RPC daemon. - A restricted RPC daemon includes a max of `RESTRICTED_TX_COUNT` txs in the `added_pool_txs` field, and returns any remaining pool hashes in the `remaining_added_pool_txids` field. The client then requests the remaining txs via `/gettransactions` in chunks. - `/gettransactions` no longer does expensive no-ops for ALL pool txs if the client requests a subset of pool txs. Instead it searches for the txs the client explicitly requests. - Reset `m_pool_info_query_time` when a user: (1) rescans the chain (so the wallet re-requests the whole pool) (2) changes the daemon their wallets points to (a new daemon would have a different view of the pool) - `/getblocks.bin` respects the `req.prune` field when returning pool txs. - Pool extension fields in response to `/getblocks.bin` are optional with default 0'd values.
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet_rpc_server.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 32628d65b..4f1b3bd21 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -149,8 +149,10 @@ namespace tools
return true;
if (boost::posix_time::microsec_clock::universal_time() < m_last_auto_refresh_time + boost::posix_time::seconds(m_auto_refresh_period))
return true;
+ uint64_t blocks_fetched = 0;
try {
- if (m_wallet) m_wallet->refresh(m_wallet->is_trusted_daemon());
+ bool received_money = false;
+ if (m_wallet) m_wallet->refresh(m_wallet->is_trusted_daemon(), 0, blocks_fetched, received_money, true, true);
} catch (const std::exception& ex) {
LOG_ERROR("Exception at while refreshing, what=" << ex.what());
}