mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
wallet2.get_reserve_proof: throw when specified amount is zero
This commit is contained in:
parent
1bbfeb325c
commit
d4f07b40de
1 changed files with 1 additions and 0 deletions
|
@ -8915,6 +8915,7 @@ std::string wallet2::get_reserve_proof(const boost::optional<std::pair<uint32_t,
|
||||||
|
|
||||||
if (account_minreserve)
|
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
|
// 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)
|
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(); });
|
{ return m_transfers[a].amount() > m_transfers[b].amount(); });
|
||||||
|
|
Loading…
Reference in a new issue