36 #include <boost/program_options/options_description.hpp>
37 #include <boost/program_options/variables_map.hpp>
38 #include <boost/serialization/list.hpp>
39 #include <boost/serialization/vector.hpp>
40 #include <boost/serialization/deque.hpp>
41 #include <boost/thread/lock_guard.hpp>
45 #include "include_base_utils.h"
49 #include "net/http_client.h"
50 #include "storages/http_abstract_invoke.h"
69 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY
70 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "wallet.wallet2"
72 class Serialization_portability_wallet_Test;
73 class wallet_accessor_test;
93 static constexpr
result_type max() {
return std::numeric_limits<result_type>::max(); }
98 std::gamma_distribution<double>
gamma;
126 virtual boost::optional<epee::wipeable_string>
on_get_password(
const char *reason) {
return boost::none; }
188 template <
class t_archive>
205 friend class ::Serialization_portability_wallet_Test;
206 friend class ::wallet_accessor_test;
210 static constexpr
const std::chrono::seconds
rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30);
231 static const char*
tr(
const char* str);
235 static std::string
device_name_option(
const boost::program_options::variables_map& vm);
237 static void init_options(boost::program_options::options_description& desc_params);
240 static std::pair<std::unique_ptr<wallet2>,
password_container>
make_from_json(
const boost::program_options::variables_map& vm,
bool unattended,
const std::string& json_file,
const std::function<boost::optional<password_container>(
const char *,
bool)> &
password_prompter);
244 make_from_file(
const boost::program_options::variables_map& vm,
bool unattended,
const std::string& wallet_file,
const std::function<boost::optional<password_container>(
const char *,
bool)> &
password_prompter);
247 static std::pair<std::unique_ptr<wallet2>,
password_container>
make_new(
const boost::program_options::variables_map& vm,
bool unattended,
const std::function<boost::optional<password_container>(
const char *,
bool)> &
password_prompter);
250 static std::unique_ptr<wallet2>
make_dummy(
const boost::program_options::variables_map& vm,
bool unattended,
const std::function<boost::optional<password_container>(
const char *,
bool)> &
password_prompter);
252 static bool verify_password(
const std::string& keys_file_name,
const epee::wipeable_string& password,
bool no_spend_key,
hw::device &hwdev, uint64_t kdf_rounds);
290 boost::optional<cryptonote::subaddress_receive_info>
received;
316 std::vector<std::pair<uint64_t, crypto::hash>>
m_uses;
319 uint64_t
amount()
const {
return m_amount; }
323 FIELD(m_block_height)
326 FIELD(m_internal_output_index)
327 FIELD(m_global_output_index)
330 FIELD(m_spent_height)
335 FIELD(m_key_image_known)
336 FIELD(m_key_image_request)
338 FIELD(m_subaddr_index)
339 FIELD(m_key_image_partial)
341 FIELD(m_multisig_info)
377 std::vector<cryptonote::tx_destination_entry>
m_dests;
379 enum { pending, pending_not_in_pool, failed } m_state;
383 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
392 std::vector<cryptonote::tx_destination_entry>
m_dests;
398 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
402 m_amount_in(utd.m_amount_in), m_amount_out(utd.m_amount_out), m_change(utd.m_change), m_block_height(
height), m_dests(utd.m_dests), m_payment_id(utd.m_payment_id), m_timestamp(utd.m_timestamp), m_unlock_time(utd.m_tx.unlock_time), m_subaddr_account(utd.m_subaddr_account), m_subaddr_indices(utd.m_subaddr_indices), m_rings(utd.m_rings) {}
407 std::vector<cryptonote::tx_source_entry>
sources;
415 std::vector<cryptonote::tx_destination_entry>
dests;
423 FIELD(selected_transfers)
429 FIELD(subaddr_account)
430 FIELD(subaddr_indices)
440 std::unordered_set<crypto::public_key>
ignore;
459 std::vector<cryptonote::tx_destination_entry>
dests;
468 FIELD(dust_added_to_fee)
470 FIELD(selected_transfers)
473 FIELD(additional_tx_keys)
475 FIELD(construction_data)
484 std::vector<tx_construction_data>
txes;
485 std::pair<size_t, wallet2::transfer_container>
transfers;
490 std::vector<pending_tx>
ptx;
508 crypto::chacha_iv
iv;
519 crypto::chacha_iv
iv;
553 std::vector<cryptonote::transaction>
txes;
562 std::vector<boost::optional<cryptonote::subaddress_receive_info>>
received;
571 bool empty()
const {
return tx_extra_fields.empty() && primary.empty() && additional.empty(); }
581 void generate(
const std::string& wallet_,
const epee::wipeable_string& password,
582 const epee::wipeable_string& multisig_data,
bool create_address_file =
false);
596 bool two_random =
false,
bool create_address_file =
false);
606 void generate(
const std::string& wallet,
const epee::wipeable_string& password,
617 void generate(
const std::string& wallet,
const epee::wipeable_string& password,
627 void restore(
const std::string& wallet_,
const epee::wipeable_string& password,
const std::string &
device_name,
bool create_address_file =
false);
634 std::string
make_multisig(
const epee::wipeable_string &password,
635 const std::vector<std::string> &
info,
642 std::string
make_multisig(
const epee::wipeable_string &password,
643 const std::vector<crypto::secret_key> &view_keys,
644 const std::vector<crypto::public_key> &spend_keys,
647 const std::vector<std::string> &
info);
652 std::unordered_set<crypto::public_key> pkeys,
653 std::vector<crypto::public_key> signers);
661 bool finalize_multisig(
const epee::wipeable_string &password,
const std::unordered_set<crypto::public_key> &pkeys, std::vector<crypto::public_key> signers);
689 void rewrite(
const std::string& wallet_name,
const epee::wipeable_string& password);
690 void write_watch_only_wallet(
const std::string& wallet_name,
const epee::wipeable_string& password, std::string &new_keys_filename);
691 void load(
const std::string& wallet,
const epee::wipeable_string& password);
698 void store_to(
const std::string &
path,
const epee::wipeable_string &password);
700 std::string
path()
const;
710 void encrypt_keys(
const epee::wipeable_string &password);
712 void decrypt_keys(
const epee::wipeable_string &password);
721 bool init(std::string daemon_address =
"http://localhost:8080",
722 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
723 boost::asio::ip::tcp::endpoint proxy = {},
724 uint64_t upper_transaction_weight_limit = 0,
725 bool trusted_daemon =
true,
726 epee::net_utils::ssl_options_t ssl_options = epee::net_utils::ssl_support_t::e_ssl_support_autodetect,
727 std::string blockchain_db_path =
"");
728 bool set_daemon(std::string daemon_address =
"http://localhost:8080",
729 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
bool trusted_daemon =
true,
730 epee::net_utils::ssl_options_t ssl_options = epee::net_utils::ssl_support_t::e_ssl_support_autodetect);
744 bool get_seed(epee::wipeable_string& electrum_words,
const epee::wipeable_string &passphrase = epee::wipeable_string())
const;
775 void add_subaddress(uint32_t index_major,
const std::string& label);
788 void refresh(
bool trusted_daemon);
789 void refresh(
bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched);
790 void refresh(
bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched,
bool& received_money,
bool check_pool =
true);
791 bool refresh(
bool trusted_daemon, uint64_t & blocks_fetched,
bool& received_money,
bool& ok);
798 bool multisig(
bool *ready = NULL, uint32_t *
threshold = NULL, uint32_t *total = NULL)
const;
801 bool get_multisig_seed(epee::wipeable_string& seed,
const epee::wipeable_string &passphrase = std::string(),
bool raw =
true)
const;
807 uint64_t
balance(uint32_t subaddr_index_major)
const;
808 uint64_t
unlocked_balance(uint32_t subaddr_index_major, uint64_t *blocks_to_unlock = NULL)
const;
816 void transfer_selected(
const std::vector<cryptonote::tx_destination_entry>& dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
817 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
819 void transfer_selected_rct(std::vector<cryptonote::tx_destination_entry> dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
820 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
824 void commit_tx(std::vector<pending_tx>& ptx_vector);
825 bool save_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename)
const;
826 std::string
dump_tx_to_str(
const std::vector<pending_tx> &ptx_vector)
const;
830 bool save_multisig_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename);
833 bool sign_tx(
const std::string &unsigned_filename,
const std::string &signed_filename, std::vector<wallet2::pending_tx> &ptx, std::function<
bool(
const unsigned_tx_set&)> accept_func = NULL,
bool export_raw =
false);
835 bool sign_tx(
unsigned_tx_set &exported_txs,
const std::string &signed_filename, std::vector<wallet2::pending_tx> &ptx,
bool export_raw =
false);
841 bool load_tx(
const std::string &signed_filename, std::vector<tools::wallet2::pending_tx> &ptx, std::function<
bool(
const signed_tx_set&)> accept_func = NULL);
842 bool parse_tx_from_str(
const std::string &signed_tx_st, std::vector<tools::wallet2::pending_tx> &ptx, std::function<
bool(
const signed_tx_set &)> accept_func);
843 std::vector<wallet2::pending_tx>
create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts,
const size_t fake_outs_count,
const uint64_t unlock_time, uint32_t priority,
const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices);
844 std::vector<wallet2::pending_tx>
create_transactions_all(uint64_t below,
const cryptonote::account_public_address &address,
bool is_subaddress,
const size_t outputs,
const size_t fake_outs_count,
const uint64_t unlock_time, uint32_t priority,
const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices);
846 std::vector<wallet2::pending_tx>
create_transactions_from(
const cryptonote::account_public_address &address,
bool is_subaddress,
const size_t outputs, std::vector<size_t> unused_transfers_indices, std::vector<size_t> unused_dust_indices,
const size_t fake_outs_count,
const uint64_t unlock_time, uint32_t priority,
const std::vector<uint8_t>& extra);
847 bool sanity_check(
const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts)
const;
848 void cold_tx_aux_import(
const std::vector<pending_tx>& ptx,
const std::vector<std::string>& tx_device_aux);
849 void cold_sign_tx(
const std::vector<pending_tx>& ptx_vector,
signed_tx_set &exported_txs, std::vector<cryptonote::address_parse_info> &dsts_info, std::vector<std::string> & tx_device_aux);
861 void get_payments(
const crypto::hash& payment_id, std::list<wallet2::payment_details>& payments, uint64_t min_height = 0,
const boost::optional<uint32_t>& subaddr_account = boost::none,
const std::set<uint32_t>& subaddr_indices = {})
const;
862 void get_payments(std::list<std::pair<crypto::hash,wallet2::payment_details>>& payments, uint64_t min_height, uint64_t max_height = (uint64_t)-1,
const boost::optional<uint32_t>& subaddr_account = boost::none,
const std::set<uint32_t>& subaddr_indices = {})
const;
863 void get_payments_out(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
864 uint64_t min_height, uint64_t max_height = (uint64_t)-1,
const boost::optional<uint32_t>& subaddr_account = boost::none,
const std::set<uint32_t>& subaddr_indices = {})
const;
865 void get_unconfirmed_payments_out(std::list<std::pair<crypto::hash,wallet2::unconfirmed_transfer_details>>& unconfirmed_payments,
const boost::optional<uint32_t>& subaddr_account = boost::none,
const std::set<uint32_t>& subaddr_indices = {})
const;
866 void get_unconfirmed_payments(std::list<std::pair<crypto::hash,wallet2::pool_payment_details>>& unconfirmed_payments,
const boost::optional<uint32_t>& subaddr_account = boost::none,
const std::set<uint32_t>& subaddr_indices = {})
const;
877 template <
class t_archive>
880 uint64_t dummy_refresh_height = 0;
885 std::vector<crypto::hash> blockchain;
887 for (
const auto &
b: blockchain)
913 a & dummy_refresh_height;
922 std::unordered_map<crypto::hash, payment_details> m;
924 for (std::unordered_map<crypto::hash, payment_details>::const_iterator i = m.begin(); i != m.end(); ++i)
950 std::unordered_multimap<crypto::hash, payment_details> m;
952 for (
const auto &i: m)
962 std::unordered_map<cryptonote::subaddress_index, crypto::public_key> dummy_subaddresses_inv;
963 a & dummy_subaddresses_inv;
998 static void wallet_exists(
const std::string& file_path,
bool& keys_file_exists,
bool& wallet_file_exists);
1007 if (
ts < 1234567890)
1016 uint64_t now =
time(NULL);
1017 uint64_t diff =
ts > now ?
ts - now : now -
ts;
1019 strftime(buffer,
sizeof(buffer),
"%Y-%m-%d", &tm);
1021 strftime(buffer,
sizeof(buffer),
"%I:%M:%S %p", &tm);
1022 return std::string(buffer);
1100 std::string
get_reserve_proof(
const boost::optional<std::pair<uint32_t, uint64_t>> &account_minreserve,
const std::string &message);
1143 size_t pop_best_value_from(
const transfer_container &transfers, std::vector<size_t> &unused_dust_indices,
const std::vector<size_t>& selected_transfers,
bool smallest =
false)
const;
1144 size_t pop_best_value(std::vector<size_t> &unused_dust_indices,
const std::vector<size_t>& selected_transfers,
bool smallest =
false)
const;
1159 const std::pair<std::map<std::string, std::string>, std::vector<std::string>>&
get_account_tags();
1165 void set_account_tag(
const std::set<uint32_t> &account_indices,
const std::string& tag);
1173 std::string
sign(
const std::string &data)
const;
1193 std::pair<size_t, std::vector<tools::wallet2::transfer_details>>
export_outputs(
bool all =
false)
const;
1195 size_t import_outputs(
const std::pair<
size_t, std::vector<tools::wallet2::transfer_details>> &outputs);
1199 void import_payments_out(
const std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>> &confirmed_payments);
1200 std::tuple<size_t, crypto::hash, std::vector<crypto::hash>>
export_blockchain()
const;
1203 std::pair<size_t, std::vector<std::pair<crypto::key_image, crypto::signature>>>
export_key_images(
bool all =
false)
const;
1204 uint64_t
import_key_images(
const std::vector<std::pair<crypto::key_image, crypto::signature>> &signed_key_images,
size_t offset, uint64_t &spent, uint64_t &unspent,
bool check_spent =
true);
1205 uint64_t
import_key_images(
const std::string &filename, uint64_t &spent, uint64_t &unspent);
1206 bool import_key_images(std::vector<crypto::key_image> key_images,
size_t offset=0, boost::optional<std::unordered_set<size_t>> selected_transfers=boost::none);
1207 bool import_key_images(signed_tx_set & signed_tx,
size_t offset=0,
bool only_selected_transfers=
false);
1213 std::string
encrypt(
const char *plaintext,
size_t len,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1216 std::string
encrypt(
const epee::wipeable_string &plaintext,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1218 template<
typename T=std::
string>
T decrypt(
const std::string &ciphertext,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1221 std::string
make_uri(
const std::string &address,
const std::string &payment_id, uint64_t amount,
const std::string &tx_description,
const std::string &recipient_name, std::string &
error)
const;
1222 bool parse_uri(
const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &
error);
1228 std::vector<std::pair<uint64_t, uint64_t>>
estimate_backlog(
const std::vector<std::pair<double, double>> &fee_levels);
1229 std::vector<std::pair<uint64_t, uint64_t>>
estimate_backlog(uint64_t min_tx_weight, uint64_t max_tx_weight,
const std::vector<uint64_t> &fees);
1253 void light_wallet_get_outs(std::vector<std::vector<get_outs_entry>> &outs,
const std::vector<size_t> &selected_transfers,
size_t fake_outputs_count);
1275 void set_attribute(
const std::string &key,
const std::string &value);
1283 template<
class t_request,
class t_response>
1284 inline bool invoke_http_json(
const boost::string_ref uri,
const t_request& req, t_response& res, std::chrono::milliseconds timeout = std::chrono::seconds(15),
const boost::string_ref http_method =
"GET")
1288 return epee::net_utils::invoke_http_json(uri, req, res,
m_http_client, timeout, http_method);
1290 template<
class t_request,
class t_response>
1291 inline bool invoke_http_bin(
const boost::string_ref uri,
const t_request& req, t_response& res, std::chrono::milliseconds timeout = std::chrono::seconds(15),
const boost::string_ref http_method =
"GET")
1295 return epee::net_utils::invoke_http_bin(uri, req, res,
m_http_client, timeout, http_method);
1297 template<
class t_request,
class t_response>
1298 inline bool invoke_http_json_rpc(
const boost::string_ref uri,
const std::string& method_name,
const t_request& req, t_response& res, std::chrono::milliseconds timeout = std::chrono::seconds(15),
const boost::string_ref http_method =
"GET",
const std::string& req_id =
"0")
1302 return epee::net_utils::invoke_http_json_rpc(uri, method_name, req, res,
m_http_client, timeout, http_method, req_id);
1310 bool unset_ring(
const std::vector<crypto::key_image> &key_images);
1320 void thaw(
size_t idx);
1321 bool frozen(
size_t idx)
const;
1325 bool frozen(
const transfer_details &td)
const;
1340 void change_password(
const std::string &filename,
const epee::wipeable_string &original_password,
const epee::wipeable_string &new_password);
1359 bool store_keys(
const std::string& keys_file_name,
const epee::wipeable_string& password,
bool watch_only =
false);
1365 bool load_keys(
const std::string& keys_file_name,
const epee::wipeable_string& password);
1366 void process_new_transaction(
const crypto::hash &txid,
const cryptonote::transaction& tx,
const std::vector<uint64_t> &o_indices, uint64_t
height, uint64_t
ts,
bool miner_tx,
bool pool,
bool double_spend_seen,
const tx_cache_data &tx_cache_data, std::map<std::pair<uint64_t, uint64_t>,
size_t> *output_tracker_cache = NULL);
1369 void detach_blockchain(uint64_t
height, std::map<std::pair<uint64_t, uint64_t>,
size_t> *output_tracker_cache = NULL);
1373 void pull_blocks(uint64_t start_height, uint64_t& blocks_start_height,
const std::list<crypto::hash> &short_chain_history, std::vector<cryptonote::block_complete_entry> &
blocks, std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> &o_indices);
1374 void pull_hashes(uint64_t start_height, uint64_t& blocks_start_height,
const std::list<crypto::hash> &short_chain_history, std::vector<crypto::hash> &hashes);
1375 void fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history,
bool force =
false);
1376 void pull_and_parse_next_blocks(uint64_t start_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history,
const std::vector<cryptonote::block_complete_entry> &prev_blocks,
const std::vector<parsed_block> &prev_parsed_blocks, std::vector<cryptonote::block_complete_entry> &
blocks, std::vector<parsed_block> &parsed_blocks,
bool &
error);
1377 void process_parsed_blocks(uint64_t start_height,
const std::vector<cryptonote::block_complete_entry> &
blocks,
const std::vector<parsed_block> &parsed_blocks, uint64_t& blocks_added, std::map<std::pair<uint64_t, uint64_t>,
size_t> *output_tracker_cache = NULL);
1378 uint64_t
select_transfers(uint64_t needed_money, std::vector<size_t> unused_transfers_indices, std::vector<size_t>& selected_transfers)
const;
1382 void add_unconfirmed_tx(
const cryptonote::transaction& tx, uint64_t amount_in,
const std::vector<cryptonote::tx_destination_entry> &dests,
const crypto::hash &payment_id, uint64_t change_amount, uint32_t subaddr_account,
const std::set<uint32_t>& subaddr_indices);
1396 std::vector<size_t>
pick_preferred_rct_inputs(uint64_t needed_money, uint32_t subaddr_account,
const std::set<uint32_t> &subaddr_indices)
const;
1399 void get_outs(std::vector<std::vector<get_outs_entry>> &outs,
const std::vector<size_t> &selected_transfers,
size_t fake_outputs_count);
1400 bool tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs, uint64_t global_index,
const crypto::public_key& tx_public_key,
const rct::key& mask, uint64_t real_index,
bool unlocked)
const;
1401 bool should_pick_a_second_output(
bool use_rct,
size_t n_transfers,
const std::vector<size_t> &unused_transfers_indices,
const std::vector<size_t> &unused_dust_indices)
const;
1402 std::vector<size_t>
get_only_rct(
const std::vector<size_t> &unused_dust_indices,
const std::vector<size_t> &unused_transfers_indices)
const;
1403 void scan_output(
const cryptonote::transaction &tx,
bool miner_tx,
const crypto::public_key &tx_pub_key,
size_t i, tx_scan_info_t &tx_scan_info,
int &num_vouts_received, std::unordered_map<cryptonote::subaddress_index, uint64_t> &tx_money_got_in_outs, std::vector<size_t> &outs,
bool pool);
1409 void update_multisig_rescan_info(
const std::vector<std::vector<rct::key>> &multisig_k,
const std::vector<std::vector<tools::wallet2::multisig_info>> &
info,
size_t n);
1415 void setup_keys(
const epee::wipeable_string &password);
1425 std::vector<crypto::public_key> &public_keys,
1426 std::vector<crypto::secret_key> &secret_keys)
const;
1428 std::vector<crypto::public_key> &signers,
1429 std::unordered_set<crypto::public_key> &pkeys)
const;
1436 void create_keys_file(
const std::string &wallet_,
bool watch_only,
const epee::wipeable_string &password,
bool create_address_file);
1462 std::unordered_map<crypto::hash, crypto::secret_key>
m_tx_keys;
1478 std::pair<std::map<std::string, std::string>, std::vector<std::string>>
m_account_tags;
1605 template <
class Archive>
1609 template <
class Archive>
1653 template <
class Archive>
1752 template <
class Archive>
1759 template <
class Archive>
1767 template <
class Archive>
1774 template <
class Archive>
1808 if (!
typename Archive::is_saving() && x.
m_change != (uint64_t)-1)
1823 template <
class Archive>
1845 if (!
typename Archive::is_saving() && x.
m_change != (uint64_t)-1)
1853 if (!
typename Archive::is_saving())
1870 template <
class Archive>
1902 template <
class Archive>
1909 template <
class Archive>
1923 template <
class Archive>
1934 template <
class Archive>
1941 template <
class Archive>
1951 template <
class Archive>
1960 std::list<size_t> selected_transfers;
1961 a & selected_transfers;
1964 for (
size_t t: selected_transfers)
1980 if (!
typename Archive::is_saving())
1987 if (!
typename Archive::is_saving())
1994 a & use_bulletproofs;
1995 if (!
typename Archive::is_saving())
2002 template <
class Archive>
2012 template <
class Archive>
2023 std::list<size_t> selected_transfers;
2024 a & selected_transfers;
2027 for (
size_t t: selected_transfers)
2055 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2057 splitted_dsts.clear();
2063 [&](uint64_t chunk) { splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, de.addr, de.is_subaddress)); },
2064 [&](uint64_t a_dust) { splitted_dsts.push_back(cryptonote::tx_destination_entry(a_dust, de.addr, de.is_subaddress)); } );
2068 [&](uint64_t chunk) {
2069 if (chunk <= dust_threshold)
2070 dust_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, false));
2072 splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, false));
2074 [&](uint64_t a_dust) { dust_dsts.push_back(cryptonote::tx_destination_entry(a_dust, change_dst.addr, false)); } );
2079 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2081 splitted_dsts = dsts;
2084 uint64_t change = change_dst.
amount;
2094 std::string indexes;
#define s(x, c)
Definition: aesb.c:47
uint64_t height
Definition: blockchain.cpp:91
uint8_t version
Definition: blockchain.cpp:90
time_t time
Definition: blockchain.cpp:93
uint8_t threshold
Definition: blockchain.cpp:92
A container for blockchain checkpoints.
Definition: checkpoints.h:52
Definition: cryptonote_basic.h:171
std::vector< tx_out > vout
Definition: cryptonote_basic.h:179
Definition: cryptonote_basic.h:205
Definition: device.hpp:71
Definition: device.hpp:87
device_type
Definition: device.hpp:105
Definition: device.hpp:77
Definition: message_store.h:203
void stop()
Definition: message_store.h:280
#define FEE_PER_KB
Definition: cryptonote_config.h:75
const uint32_t T[512]
Definition: groestl_tables.h:37
string a
Definition: MakeCryptoOps.py:15
boost::optional< tools::password_container > password_prompter(const char *prompt, bool verify)
Definition: simplewallet.cpp:300
tools::wallet2::RefreshType refresh_type
Definition: simplewallet.cpp:401
int b
Definition: base.py:1
Definition: blocks.cpp:13
std::enable_if< Archive::is_loading::value, void >::type initialize_transfer_details(Archive &a, tools::wallet2::transfer_details &x, const boost::serialization::version_type ver)
Definition: wallet2.h:1610
Definition: unordered_containers_boost_serialization.h:39
crypto namespace.
Definition: crypto.cpp:58
static const crypto::hash null_hash
Definition: hash.h:101
POD_CLASS signature
Definition: crypto.h:108
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:82
POD_CLASS hash8
Definition: hash.h:53
POD_CLASS key_derivation
Definition: crypto.h:98
POD_CLASS public_key
Definition: crypto.h:76
POD_CLASS key_image
Definition: crypto.h:102
POD_CLASS hash
Definition: hash.h:50
network_type
Definition: cryptonote_config.h:243
@ MAINNET
Definition: cryptonote_config.h:244
void decompose_amount_into_digits(uint64_t amount, uint64_t dust_threshold, const chunk_handler_t &chunk_handler, const dust_handler_t &dust_handler)
Definition: cryptonote_format_utils.h:208
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:940
crypto::hash get_transaction_hash(const transaction &t)
Definition: cryptonote_format_utils.cpp:968
std::string blobdata
Definition: blobdatatype.h:39
declaration and default definition for the functions used the API
Definition: expect.cpp:34
tools::wallet2::tx_construction_data tx_construction_data
Definition: protocol.hpp:156
tools::wallet2::unsigned_tx_set unsigned_tx_set
Definition: protocol.hpp:157
mdb_size_t count(MDB_cursor *cur)
Definition: value_stream.cpp:39
error
Tracks LMDB error codes.
Definition: error.h:45
static void add(ge_p3 &p3, const ge_cached &other)
Definition: multiexp.cc:143
@ RangeProofBorromean
Definition: rctTypes.h:235
@ RangeProofBulletproof
Definition: rctTypes.h:235
key identity()
Definition: rctOps.h:73
Definition: binary_utils.h:37
Definition: blockchain_ancestry.cpp:73
BOOST_CLASS_VERSION(nodetool::peerlist_types, nodetool::CURRENT_PEERLIST_STORAGE_ARCHIVE_VER)
#define BEGIN_SERIALIZE_OBJECT()
begins the environment of the DSL \detailed for described the serialization of an object
Definition: serialization.h:190
#define FIELD(f)
tags the field with the variable name and then serializes it
Definition: serialization.h:243
#define END_SERIALIZE()
self-explanatory
Definition: serialization.h:214
static const unsigned char iv[64]
Definition: sha512-hash.c:13
#define ts
Definition: skein.c:522
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:91
#define true
Definition: stdbool.h:37
Definition: core_rpc_server_commands_defs.h:146
Definition: cryptonote_basic.h:453
Definition: cryptonote_protocol_defs.h:118
Definition: cryptonote_basic.h:410
Definition: cryptonote_basic.h:480
Definition: subaddress_index.h:39
Definition: cryptonote_tx_utils.h:76
uint64_t amount
Definition: cryptonote_tx_utils.h:78
account_public_address addr
Definition: cryptonote_tx_utils.h:79
Definition: cryptonote_basic.h:144
Definition: cryptonote_tx_utils.h:44
uint64_t amount
Definition: cryptonote_tx_utils.h:52
size_t real_output
Definition: cryptonote_tx_utils.h:48
std::vector< output_entry > outputs
Definition: cryptonote_tx_utils.h:47
std::pair< uint64_t, rct::ctkey > output_entry
Definition: cryptonote_tx_utils.h:45
size_t real_output_in_tx_index
Definition: cryptonote_tx_utils.h:51
Definition: cryptonote_basic.h:78
crypto::public_key key
Definition: cryptonote_basic.h:81
Definition: message_store.h:190
Definition: rctTypes.h:236
RangeProofType range_proof_type
Definition: rctTypes.h:237
Definition: rctTypes.h:78
Definition: rctTypes.h:104
Definition: rctTypes.h:111
Definition: rctTypes.h:436
Definition: wallet2.h:538
crypto::public_key shared_secret
Definition: wallet2.h:541
crypto::signature key_image_sig
Definition: wallet2.h:544
crypto::signature shared_secret_sig
Definition: wallet2.h:543
uint64_t index_in_tx
Definition: wallet2.h:540
crypto::key_image key_image
Definition: wallet2.h:542
crypto::hash txid
Definition: wallet2.h:539