diff options
| author | j-berman <justinberman@protonmail.com> | 2025-09-17 15:21:46 -0700 |
|---|---|---|
| committer | j-berman <justinberman@protonmail.com> | 2025-10-06 13:25:19 -0700 |
| commit | 18299929706ef29a98d0c301e2b41a3db932933a (patch) | |
| tree | 100b8ed8815dcb21bebc12d86da45b66d988b74c | |
| parent | a440e917906b92b74daa107e49fcb963266242fa (diff) | |
| download | monzero-core-18299929706ef29a98d0c301e2b41a3db932933a.tar.gz monzero-core-18299929706ef29a98d0c301e2b41a3db932933a.tar.xz monzero-core-18299929706ef29a98d0c301e2b41a3db932933a.zip | |
wallet2: warn instead of throw when RingDB doesn't include spend
A reorg can end up causing an output's position in the chain to
move. Since the wallet doesn't update the RingDB on reorg, it
may refer to the output's stale position in the chain.
This seems a reasonable solution rather than introducing complex
logic to update the stale ring member's value on rerog, since
RingDB can be deprecated with FCMP++.
| -rw-r--r-- | src/wallet/wallet2.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3cb583afe..aedcaba06 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -9518,8 +9518,11 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>> MINFO("Ignoring output " << out << ", too recent"); } } - THROW_WALLET_EXCEPTION_IF(!own_found, error::wallet_internal_error, - "Known ring does not include the spent output: " + std::to_string(td.m_global_output_index)); + if (!own_found) + { + MWARNING("Known ring does not include the spent output: " + std::to_string(td.m_global_output_index) + + ", there may have been a reorg that moved the spent output's position in the chain"); + } } } |
