From adeaa69331add918bd4cb4d2bf7c99c2a305425b Mon Sep 17 00:00:00 2001 From: Navid Rahimi Date: Fri, 6 Feb 2026 20:23:51 +0000 Subject: [PATCH] wallet: rescan_blockchain missing keep_key_images --- src/wallet/wallet_rpc_server.cpp | 8 +++++++- src/wallet/wallet_rpc_server_commands_defs.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index d68db3b6a..c7b6d7d00 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -2360,10 +2360,16 @@ namespace tools bool wallet_rpc_server::on_rescan_blockchain(const wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::request& req, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::response& res, epee::json_rpc::error& er, const connection_context *ctx) { CHECK_IF_RESTRICTED_BACKGROUND_SYNCING(); + if (req.hard && req.keep_key_images) + { + er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR; + er.message = "Cannot preserve key images on hard rescan"; + return false; + } try { - m_wallet->rescan_blockchain(req.hard); + m_wallet->rescan_blockchain(req.hard, true, req.keep_key_images); } catch (const std::exception& e) { diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index bb087cad5..09d4ae96d 100644 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -1220,9 +1220,11 @@ namespace wallet_rpc struct request_t { bool hard; + bool keep_key_images; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE_OPT(hard, false) + KV_SERIALIZE_OPT(keep_key_images, false) END_KV_SERIALIZE_MAP() }; typedef epee::misc_utils::struct_init request;