aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2026-04-28 16:40:32 +0200
committertobtoht <tob@featherwallet.org>2026-04-28 16:40:32 +0200
commitf855ffe87ddc593b286ad02f84b24b804872773a (patch)
tree972347e622a871802cea28b7e42944c912976546
parent586e82bcc0f9491a14bb9b824248925d09f68c75 (diff)
downloadmonzero-core-f855ffe87ddc593b286ad02f84b24b804872773a.tar.gz
monzero-core-f855ffe87ddc593b286ad02f84b24b804872773a.tar.xz
monzero-core-f855ffe87ddc593b286ad02f84b24b804872773a.zip
wallet2: throw if reserve proof can't be parsed
-rw-r--r--src/wallet/wallet2.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index b57ae3b69..f06cfce8b 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -13396,13 +13396,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");