diff options
author | stoffu <stoffu@protonmail.ch> | 2018-09-04 13:00:38 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-09-04 13:00:38 +0900 |
commit | 5f8f56315ce55103fc56c12b2b5178084ccf314c (patch) | |
tree | 2d3854a181e223c50548cbc77f618c6bf49bf334 /src | |
parent | Merge pull request #4223 (diff) | |
download | monero-5f8f56315ce55103fc56c12b2b5178084ccf314c.tar.xz |
wallet2.get_reserve_proof: throw when specified amount is zero
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet2.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 96b77a7a6..d207f35e5 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -9566,6 +9566,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(); }); |