wallet2: throw if reserve proof can't be parsed

(cherry picked from commit f855ffe87ddc593b286ad02f84b24b804872773a)
This commit is contained in:
tobtoht
2026-05-06 10:52:36 -04:00
committed by jwinterm
parent 0bf3b9f441
commit 36bbd1a2c7
+10 -4
View File
@@ -13413,13 +13413,19 @@ bool wallet2::check_reserve_proof(const cryptonote::account_public_address &addr
loaded = true;
}
catch(...) {}
if (!loaded && m_load_deprecated_formats)
try
{
std::istringstream iss(sig_decoded);
boost::archive::portable_binary_iarchive ar(iss);
ar >> proofs >> subaddr_spendkeys.parent();
if (!loaded && m_load_deprecated_formats)
{
std::istringstream iss(sig_decoded);
boost::archive::portable_binary_iarchive ar(iss);
ar >> proofs >> subaddr_spendkeys.parent();
loaded = true;
}
}
catch(...) {}
THROW_WALLET_EXCEPTION_IF(!loaded, error::wallet_internal_error, "Failed to parse reserve proof signature data");
THROW_WALLET_EXCEPTION_IF(subaddr_spendkeys.count(address.m_spend_public_key) == 0, error::wallet_internal_error,
"The given address isn't found in the proof");