Skip to content

Commit 1a0bc5c

Browse files
committed
carrot_impl: tx_builder: better error message when no IPSCs
1 parent 47e3136 commit 1a0bc5c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/wallet/tx_builder.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#include "tx_builder.h"
3131

3232
//local headers
33-
#include "carrot_core/device_ram_borrowed.h"
34-
#include "carrot_core/enote_utils.h"
3533
#include "carrot_core/exceptions.h"
3634
#include "carrot_core/output_set_finalization.h"
3735
#include "carrot_core/scan.h"
@@ -45,11 +43,13 @@
4543
#include "common/threadpool.h"
4644
#include "crypto/generators.h"
4745
#include "cryptonote_basic/cryptonote_format_utils.h"
46+
#include "cryptonote_config.h"
4847
#include "cryptonote_core/blockchain.h"
4948
#include "fcmp_pp/fcmp_pp_types.h"
5049
#include "fcmp_pp/proof_len.h"
5150
#include "fcmp_pp/prove.h"
5251
#include "fcmp_pp/tower_cycle.h"
52+
#include "misc_log_ex.h"
5353
#include "ringct/bulletproofs_plus.h"
5454
#include "ringct/rctSigs.h"
5555

@@ -76,7 +76,7 @@ static constexpr T div_ceil(T dividend, T divisor)
7676
//-------------------------------------------------------------------------------------------------------------------
7777
static bool is_transfer_usable_for_input_selection(const wallet2_basic::transfer_details &td,
7878
const std::uint32_t from_account,
79-
const std::set<std::uint32_t> from_subaddresses,
79+
const std::set<std::uint32_t> &from_subaddresses,
8080
const rct::xmr_amount ignore_above,
8181
const rct::xmr_amount ignore_below,
8282
const uint64_t top_block_index)
@@ -562,6 +562,8 @@ std::vector<carrot::CarrotTransactionProposalV1> make_carrot_transaction_proposa
562562
ignore_above,
563563
ignore_below,
564564
top_block_index);
565+
CARROT_CHECK_AND_THROW(!input_candidates.empty(),
566+
carrot::not_enough_usable_money, "No unlocked or otherwise usable money in selected addresses/accounts");
565567

566568
const carrot::input_selection_policy_t isp = &carrot::ispolicy::select_greedy_aging;
567569

0 commit comments

Comments
 (0)