aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-09-14 13:06:06 +0200
committerRiccardo Spagni <ric@spagni.net>2018-09-14 13:06:06 +0200
commitb182dc826297a5f1718d0fe54ee8949ea3a8223c (patch)
tree16ae190cba193bf74d22c0b0718f0ae9b3cfa64a /src
parentMerge pull request #4332 (diff)
parentwallet2.get_reserve_proof: throw when specified amount is zero (diff)
downloadmonero-b182dc826297a5f1718d0fe54ee8949ea3a8223c.tar.xz
Merge pull request #4336
5f8f5631 wallet2.get_reserve_proof: throw when specified amount is zero (stoffu)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 1982bd339..0b1c9d995 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -9472,6 +9472,7 @@ std::string wallet2::get_reserve_proof(const boost::optional<std::pair<uint32_t,
if (account_minreserve)
{
+ THROW_WALLET_EXCEPTION_IF(account_minreserve->second == 0, error::wallet_internal_error, "Proved amount must be greater than 0");
// minimize the number of outputs included in the proof, by only picking the N largest outputs that can cover the requested min reserve amount
std::sort(selected_transfers.begin(), selected_transfers.end(), [&](const size_t a, const size_t b)
{ return m_transfers[a].amount() > m_transfers[b].amount(); });