aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2023-06-27 11:20:25 -0500
committerluigi1111 <luigi1111w@gmail.com>2023-06-27 11:20:25 -0500
commit60e9426ef2f27b5af7539393535475b0614e1262 (patch)
treeb07d4d1d1d10b13e74b9cd68a92adba697e5c23b /src/wallet/wallet_rpc_server.cpp
parentMerge pull request #8846 (diff)
parentwallet2: fix rescanning tx via scan_tx (diff)
downloadmonero-60e9426ef2f27b5af7539393535475b0614e1262.tar.xz
Merge pull request #8566
65e13db wallet2: fix rescanning tx via scan_tx (j-berman)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r--src/wallet/wallet_rpc_server.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 964945175..32628d65b 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -3167,7 +3167,7 @@ namespace tools
return false;
}
- std::vector<crypto::hash> txids;
+ std::unordered_set<crypto::hash> txids;
std::list<std::string>::const_iterator i = req.txids.begin();
while (i != req.txids.end())
{
@@ -3180,11 +3180,15 @@ namespace tools
}
crypto::hash txid = *reinterpret_cast<const crypto::hash*>(txid_blob.data());
- txids.push_back(txid);
+ txids.insert(txid);
}
try {
m_wallet->scan_tx(txids);
+ } catch (const tools::error::wont_reprocess_recent_txs_via_untrusted_daemon &e) {
+ er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
+ er.message = e.what() + std::string(". Either connect to a trusted daemon or rescan the chain.");
+ return false;
} catch (const std::exception &e) {
handle_rpc_exception(std::current_exception(), er, WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR);
return false;