From b0c18ef9cdb7f0481c176f50aec1d31cb3f97830 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 17 Apr 2016 11:20:44 +0100 Subject: [PATCH 1/2] wallet2: move output selection api public --- src/wallet/wallet2.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 179d1553e..93bd168e5 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -364,6 +364,12 @@ namespace tools std::string get_wallet_file() const; std::string get_keys_file() const; + + std::vector select_available_outputs_from_histogram(uint64_t count, bool atleast, bool trusted_daemon); + std::vector select_available_outputs(const std::function &f); + std::vector select_available_unmixable_outputs(bool trusted_daemon); + std::vector select_available_mixable_outputs(bool trusted_daemon); + private: /*! * \brief Stores wallet information to wallet file. @@ -403,10 +409,6 @@ namespace tools uint64_t get_upper_tranaction_size_limit(); void check_pending_txes(); std::vector get_unspent_amounts_vector(); - std::vector select_available_outputs_from_histogram(uint64_t count, bool atleast, bool trusted_daemon); - std::vector select_available_outputs(const std::function &f); - std::vector select_available_unmixable_outputs(bool trusted_daemon); - std::vector select_available_mixable_outputs(bool trusted_daemon); cryptonote::account_base m_account; std::string m_daemon_address; From 672162d9e29f53f937e26dca0ab863d247ce2420 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 17 Apr 2016 11:21:01 +0100 Subject: [PATCH 2/2] tests: fix compile failure on wallet2::transfer --- tests/functional_tests/transactions_flow_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functional_tests/transactions_flow_test.cpp b/tests/functional_tests/transactions_flow_test.cpp index 159ccfd83..6bf910101 100644 --- a/tests/functional_tests/transactions_flow_test.cpp +++ b/tests/functional_tests/transactions_flow_test.cpp @@ -85,7 +85,8 @@ bool do_send_money(tools::wallet2& w1, tools::wallet2& w2, size_t mix_in_factor, try { tools::wallet2::pending_tx ptx; - w1.transfer(dsts, mix_in_factor, 0, TEST_FEE, std::vector(), tools::detail::null_split_strategy, tools::tx_dust_policy(TEST_DUST_THRESHOLD), tx, ptx, true); + std::vector indices = w1.select_available_outputs([](const tools::wallet2::transfer_details&) { return true; }); + w1.transfer(dsts, mix_in_factor, indices, 0, TEST_FEE, std::vector(), tools::detail::null_split_strategy, tools::tx_dust_policy(TEST_DUST_THRESHOLD), tx, ptx, true); w1.commit_tx(ptx); return true; }