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++.
This commit is contained in:
j-berman 2025-09-17 15:21:46 -07:00
parent 8d4c625713
commit 1dbb4a7928

View File

@ -9300,8 +9300,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");
}
}
}