36 #include <boost/program_options/options_description.hpp>
37 #include <boost/program_options/variables_map.hpp>
38 #include <boost/serialization/unordered_map.hpp>
40 #if BOOST_VERSION >= 107400
41 #include <boost/serialization/library_version_type.hpp>
43 #include <boost/serialization/list.hpp>
44 #include <boost/serialization/vector.hpp>
45 #include <boost/serialization/deque.hpp>
46 #include <boost/thread/lock_guard.hpp>
75 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY
76 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "wallet.wallet2"
78 class Serialization_portability_wallet_Test;
92 gamma_picker(
const std::vector<uint64_t> &rct_offsets,
double shape,
double scale);
98 static constexpr result_type min() {
return 0; }
99 static constexpr result_type max() {
return std::numeric_limits<result_type>::max(); }
100 result_type operator()() {
return crypto::rand<result_type>(); }
104 std::gamma_distribution<double> gamma;
105 const std::vector<uint64_t> &rct_offsets;
108 double average_output_time;
120 crypto::chacha_key key;
132 virtual boost::optional<epee::wipeable_string>
on_get_password(
const char *reason) {
return boost::none; }
181 size_t size()
const {
return m_blockchain.size() + m_offset; }
182 size_t offset()
const {
return m_offset; }
189 void clear() { m_offset = 0; m_blockchain.clear(); }
190 bool empty()
const {
return m_blockchain.empty() && m_offset == 0; }
191 void trim(
size_t height) {
while (
height > m_offset && m_blockchain.size() > 1) { m_blockchain.pop_front(); ++m_offset; } m_blockchain.shrink_to_fit(); }
194 template <
class t_archive>
205 std::deque<crypto::hash> m_blockchain;
208 class wallet_keys_unlocker;
211 friend class ::Serialization_portability_wallet_Test;
212 friend class ::wallet_accessor_test;
216 static constexpr
const std::chrono::seconds
rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30);
237 static const char*
tr(
const char* str);
243 static void init_options(boost::program_options::options_description& desc_params);
246 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);
250 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);
253 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);
256 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);
296 boost::optional<cryptonote::subaddress_receive_info>
received;
322 std::vector<std::pair<uint64_t, crypto::hash>>
m_uses;
327 const std::pair<crypto::hash, size_t>
get_chainstate_index()
const {
return std::make_pair(m_txid, m_internal_output_index); }
330 FIELD(m_block_height)
333 FIELD(m_internal_output_index)
334 FIELD(m_global_output_index)
337 FIELD(m_spent_height)
342 FIELD(m_key_image_known)
343 FIELD(m_key_image_request)
345 FIELD(m_subaddr_index)
346 FIELD(m_key_image_partial)
348 FIELD(m_multisig_info)
385 std::vector<cryptonote::tx_destination_entry>
m_dests;
387 enum {
pending, pending_not_in_pool, failed } m_state;
391 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
400 std::vector<cryptonote::tx_destination_entry>
m_dests;
406 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
411 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), m_is_migration(utd.m_tx.
version == 2) {}
416 std::vector<cryptonote::tx_source_entry>
sources;
424 std::vector<cryptonote::tx_destination_entry>
dests;
432 FIELD(selected_transfers)
438 FIELD(subaddr_account)
439 FIELD(subaddr_indices)
449 std::unordered_set<crypto::public_key>
ignore;
468 std::vector<cryptonote::tx_destination_entry>
dests;
477 FIELD(dust_added_to_fee)
479 FIELD(selected_transfers)
482 FIELD(additional_tx_keys)
484 FIELD(construction_data)
493 std::vector<tx_construction_data>
txes;
494 std::pair<size_t, wallet2::transfer_container>
transfers;
499 std::vector<pending_tx>
ptx;
517 crypto::chacha_iv
iv;
528 crypto::chacha_iv
iv;
562 std::vector<cryptonote::transaction>
txes;
571 std::vector<boost::optional<cryptonote::subaddress_receive_info>>
received;
592 bool empty()
const {
return tx_extra_fields.empty() && primary.empty() && additional.empty() && public_outs.empty(); }
593 bool public_only()
const {
return !public_outs.empty() && primary.empty() && additional.empty(); }
618 bool two_random =
false,
bool create_address_file =
false);
657 const std::vector<std::string> &
info,
665 const std::vector<crypto::secret_key> &view_keys,
666 const std::vector<crypto::public_key> &spend_keys,
669 const std::vector<std::string> &
info);
674 std::unordered_set<crypto::public_key> pkeys,
675 std::vector<crypto::public_key> signers);
744 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
745 boost::asio::ip::tcp::endpoint proxy = {},
746 uint64_t upper_transaction_weight_limit = 0,
747 bool trusted_daemon =
true,
751 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
bool trusted_daemon =
true,
754 void stop() { m_run.store(
false, std::memory_order_relaxed); m_message_store.stop(); }
796 size_t get_num_subaddresses(
uint32_t index_major)
const {
return index_major < m_subaddress_labels.size() ? m_subaddress_labels[index_major].size() : 0; }
802 std::pair<size_t, size_t>
get_subaddress_lookahead()
const {
return {m_subaddress_lookahead_major, m_subaddress_lookahead_minor}; }
810 void refresh(
bool trusted_daemon);
812 void refresh(
bool trusted_daemon,
uint64_t start_height,
uint64_t & blocks_fetched,
bool& received_etn,
bool check_pool =
true);
813 bool refresh(
bool trusted_daemon,
uint64_t & blocks_fetched,
bool& received_etn,
bool& ok);
840 void transfer_selected(
const std::vector<cryptonote::tx_destination_entry>& dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
841 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
844 void commit_tx(std::vector<pending_tx>& ptx_vector);
845 bool save_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename)
const;
856 bool sign_tx(
unsigned_tx_set &exported_txs, std::vector<wallet2::pending_tx> &ptx, signed_tx_set &signed_txs);
861 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);
862 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);
863 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);
864 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,
const bool migrate =
false);
867 bool sanity_check(
const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts)
const;
868 void cold_tx_aux_import(
const std::vector<pending_tx>& ptx,
const std::vector<std::string>& tx_device_aux);
869 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);
875 bool sign_multisig_tx(multisig_tx_set &exported_txs, std::vector<crypto::hash> &txids);
881 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;
882 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;
883 void get_payments_out(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
884 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;
886 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;
887 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;
888 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;
901 template <
class t_archive>
909 std::vector<crypto::hash> blockchain;
911 for (
const auto &b: blockchain)
913 m_blockchain.push_back(b);
921 a & m_account_public_address;
925 a & m_unconfirmed_txs;
937 a & dummy_refresh_height;
946 std::unordered_map<crypto::hash, payment_details> m;
948 for (std::unordered_map<crypto::hash, payment_details>::const_iterator i = m.begin(); i != m.end(); ++i)
949 m_unconfirmed_payments.insert(std::make_pair(i->first,
pool_payment_details{i->second, false}));
956 for (
size_t i = 0; i < m_transfers.size(); ++i)
961 m_pub_keys.emplace(o.
key, i);
974 std::unordered_multimap<crypto::hash, payment_details> m;
976 for (
const auto &i: m)
981 a & m_scanned_pool_txs[0];
982 a & m_scanned_pool_txs[1];
986 std::unordered_map<cryptonote::subaddress_index, crypto::public_key> dummy_subaddresses_inv;
987 a & dummy_subaddresses_inv;
988 a & m_subaddress_labels;
989 a & m_additional_tx_keys;
995 a & m_unconfirmed_payments;
1001 a & m_ring_history_saved;
1004 a & m_last_block_reward;
1010 a & m_device_last_key_image_sync;
1013 a & m_cold_key_images;
1016 a & m_chainstate_indexes;
1034 if (ts < 1234567890)
1044 uint64_t diff = ts > now ? ts - now : now - ts;
1046 strftime(buffer,
sizeof(buffer),
"%Y-%m-%d", &tm);
1048 strftime(buffer,
sizeof(buffer),
"%I:%M:%S %p", &tm);
1157 const boost::optional<epee::net_utils::http::login>&
get_daemon_login()
const {
return m_daemon_login; }
1170 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;
1171 size_t pop_best_value(std::vector<size_t> &unused_dust_indices,
const std::vector<size_t>& selected_transfers,
bool smallest =
false)
const;
1186 const std::pair<std::map<std::string, std::string>, std::vector<std::string>>&
get_account_tags();
1220 std::pair<size_t, std::vector<tools::wallet2::transfer_details>>
export_outputs(
bool all =
false)
const;
1222 size_t import_outputs(
const std::pair<
size_t, std::vector<tools::wallet2::transfer_details>> &outputs);
1226 void import_payments_out(
const std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>> &confirmed_payments);
1227 std::tuple<size_t, crypto::hash, std::vector<crypto::hash>>
export_blockchain()
const;
1230 std::pair<size_t, std::vector<std::pair<crypto::key_image, crypto::signature>>>
export_key_images(
bool all =
false)
const;
1233 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);
1255 std::vector<std::pair<uint64_t, uint64_t>>
estimate_backlog(
const std::vector<std::pair<double, double>> &fee_levels);
1280 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);
1310 template<
class t_request,
class t_response>
1311 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")
1313 if (m_offline)
return false;
1314 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1317 template<
class t_request,
class t_response>
1318 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")
1320 if (m_offline)
return false;
1321 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1324 template<
class t_request,
class t_response>
1327 if (m_offline)
return false;
1328 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1337 bool unset_ring(
const std::vector<crypto::key_image> &key_images);
1347 void thaw(
size_t idx);
1348 bool frozen(
size_t idx)
const;
1352 bool frozen(
const transfer_details &td)
const;
1369 void set_tx_notify(
const std::shared_ptr<tools::Notify> ¬ify) { m_tx_notify = notify; }
1393 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,
bool nonexistent_utxo_seen,
const tx_cache_data &tx_cache_data, std::pair<std::map<std::pair<uint64_t, uint64_t>,
size_t>, std::map<std::pair<std::array<char, 32>,
size_t>,
size_t>> *output_tracker_cache = NULL);
1395 void process_new_blockchain_entry(
const cryptonote::block& b,
const cryptonote::block_complete_entry& bche,
const parsed_block &parsed_block,
const crypto::hash& bl_id,
uint64_t height,
const std::vector<tx_cache_data> &tx_cache_data,
size_t tx_cache_data_offset, std::pair<std::map<std::pair<uint64_t, uint64_t>,
size_t>, std::map<std::pair<std::array<char, 32>,
size_t>,
size_t>> *output_tracker_cache = NULL);
1396 void detach_blockchain(
uint64_t height, std::pair<std::map<std::pair<uint64_t, uint64_t>,
size_t>, std::map<std::pair<std::array<char, 32>,
size_t>,
size_t>> *output_tracker_cache = NULL);
1397 void get_short_chain_history(std::list<crypto::hash>& ids,
uint64_t granularity = 1)
const;
1399 void clear_soft(
bool keep_key_images=
false);
1400 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);
1401 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);
1402 void fast_refresh(
uint64_t stop_height,
uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history,
bool force =
false);
1403 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);
1404 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::pair<std::map<std::pair<uint64_t, uint64_t>,
size_t>, std::map<std::pair<std::array<char, 32>,
size_t>,
size_t>> *output_tracker_cache = NULL);
1405 uint64_t select_transfers(
uint64_t needed_etn, std::vector<size_t> unused_transfers_indices, std::vector<size_t>& selected_transfers)
const;
1406 bool prepare_file_names(
const std::string& file_path);
1411 void check_genesis(
const crypto::hash& genesis_hash)
const;
1412 bool generate_chacha_key_from_secret_keys(crypto::chacha_key &
key)
const;
1414 crypto::hash get_payment_id(
const pending_tx &ptx)
const;
1415 void check_acc_out_precomp(
const cryptonote::tx_out &o,
const crypto::key_derivation &derivation,
const std::vector<crypto::key_derivation> &additional_derivations,
size_t i, tx_scan_info_t &tx_scan_info)
const;
1416 void check_acc_out_precomp(
const cryptonote::tx_out &o,
const crypto::key_derivation &derivation,
const std::vector<crypto::key_derivation> &additional_derivations,
size_t i,
const is_out_data *is_out_data, tx_scan_info_t &tx_scan_info)
const;
1417 void check_acc_out_precomp_once(
const cryptonote::tx_out &o,
const crypto::key_derivation &derivation,
const std::vector<crypto::key_derivation> &additional_derivations,
size_t i,
const is_out_data *is_out_data, tx_scan_info_t &tx_scan_info,
bool &already_seen)
const;
1419 uint64_t get_upper_transaction_weight_limit()
const;
1420 std::vector<uint64_t> get_unspent_amounts_vector()
const;
1421 uint64_t get_dynamic_base_fee_estimate()
const;
1422 float get_output_relatedness(
const transfer_details &td0,
const transfer_details &td1)
const;
1423 std::vector<size_t> pick_preferred_rct_inputs(
uint64_t needed_etn,
uint32_t subaddr_account,
const std::set<uint32_t> &subaddr_indices)
const;
1424 void set_spent(
size_t idx,
uint64_t height,
bool public_out =
false);
1425 void set_unspent(
size_t idx,
bool public_out =
false);
1426 void get_outs(std::vector<std::vector<get_outs_entry>> &outs,
const std::vector<size_t> &selected_transfers,
size_t fake_outputs_count,
const uint8_t tx_version);
1427 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;
1428 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;
1429 std::vector<size_t> get_only_rct(
const std::vector<size_t> &unused_dust_indices,
const std::vector<size_t> &unused_transfers_indices)
const;
1430 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_etn_got_in_outs, std::vector<size_t> &outs,
bool pool);
1431 void trim_hashchain();
1433 rct::multisig_kLRki get_multisig_composite_kLRki(
size_t n,
const std::unordered_set<crypto::public_key> &ignore_set, std::unordered_set<rct::key> &used_L, std::unordered_set<rct::key> &new_used_L)
const;
1435 rct::key get_multisig_k(
size_t idx,
const std::unordered_set<rct::key> &used_L)
const;
1436 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);
1441 crypto::chacha_key get_ringdb_key();
1445 void register_devices();
1448 bool get_rct_distribution(
uint64_t &start_height, std::vector<uint64_t> &distribution);
1450 uint64_t get_segregation_fork_height()
const;
1451 void unpack_multisig_info(
const std::vector<std::string>&
info,
1452 std::vector<crypto::public_key> &public_keys,
1453 std::vector<crypto::secret_key> &secret_keys)
const;
1454 bool unpack_extra_multisig_info(
const std::vector<std::string>&
info,
1455 std::vector<crypto::public_key> &signers,
1456 std::unordered_set<crypto::public_key> &pkeys)
const;
1461 std::shared_ptr<std::pair<std::map<std::pair<uint64_t, uint64_t>,
size_t>, std::map<std::pair<std::array<char, 32>,
size_t>,
size_t>>> create_output_tracker_cache()
const;
1464 void setup_new_blockchain();
1468 void on_device_button_request(
uint64_t code);
1469 void on_device_button_pressed();
1470 boost::optional<epee::wipeable_string> on_device_pin_request();
1471 boost::optional<epee::wipeable_string> on_device_passphrase_request(
bool on_device);
1475 void throw_on_rpc_response_error(
const boost::optional<std::string> &status,
const char *method)
const;
1481 boost::optional<epee::net_utils::http::login> m_daemon_login;
1488 std::unordered_map<crypto::hash, unconfirmed_transfer_details> m_unconfirmed_txs;
1489 std::unordered_map<crypto::hash, confirmed_transfer_details> m_confirmed_txs;
1490 std::unordered_multimap<crypto::hash, pool_payment_details> m_unconfirmed_payments;
1491 std::unordered_map<crypto::hash, crypto::secret_key> m_tx_keys;
1493 uint64_t fallback_to_pow_checkpoint_height;
1495 std::unordered_map<crypto::hash, std::vector<crypto::secret_key>> m_additional_tx_keys;
1499 std::unordered_map<crypto::key_image, size_t> m_key_images;
1500 std::unordered_map<crypto::public_key, size_t> m_pub_keys;
1501 std::unordered_map<std::pair<crypto::hash, size_t>, size_t, boost::hash<std::pair<crypto::hash, size_t>>> m_chainstate_indexes;
1503 std::unordered_map<crypto::public_key, cryptonote::subaddress_index> m_subaddresses;
1504 std::vector<std::vector<std::string>> m_subaddress_labels;
1505 std::unordered_map<crypto::hash, std::string> m_tx_notes;
1506 std::unordered_map<std::string, std::string> m_attributes;
1507 std::vector<tools::wallet2::address_book_row> m_address_book;
1508 std::pair<std::map<std::string, std::string>, std::vector<std::string>> m_account_tags;
1509 uint64_t m_upper_transaction_weight_limit;
1510 const std::vector<std::vector<tools::wallet2::multisig_info>> *m_multisig_rescan_info;
1511 const std::vector<std::vector<rct::key>> *m_multisig_rescan_k;
1512 std::unordered_map<crypto::public_key, crypto::key_image> m_cold_key_images;
1514 std::atomic<bool> m_run;
1516 boost::recursive_mutex m_daemon_rpc_mutex;
1518 bool m_trusted_daemon;
1524 bool is_old_file_format;
1528 std::vector<crypto::public_key> m_multisig_signers;
1531 std::vector<crypto::public_key> m_multisig_derivations;
1532 bool m_always_confirm_transfers;
1533 bool m_print_ring_members;
1534 bool m_store_tx_info;
1538 bool m_auto_refresh;
1539 bool m_first_refresh_done;
1540 uint64_t m_refresh_from_block_height;
1543 bool m_explicit_refresh_from_block_height;
1544 bool m_confirm_missing_payment_id;
1545 bool m_confirm_non_default_ring_size;
1549 bool m_merge_destinations;
1550 bool m_confirm_backlog;
1551 uint32_t m_confirm_backlog_threshold;
1552 bool m_confirm_export_overwrite;
1553 bool m_auto_low_priority;
1554 bool m_segregate_pre_fork_outputs;
1555 bool m_key_reuse_mitigation2;
1557 bool m_ignore_fractional_outputs;
1560 bool m_is_initialized;
1562 std::unordered_set<crypto::hash> m_scanned_pool_txs[2];
1563 size_t m_subaddress_lookahead_major, m_subaddress_lookahead_minor;
1566 uint64_t m_device_last_key_image_sync;
1571 std::unordered_map<crypto::hash, std::string> m_tx_device;
1574 bool m_light_wallet;
1575 uint64_t m_light_wallet_scanned_block_height;
1576 uint64_t m_light_wallet_blockchain_height;
1578 bool m_light_wallet_connected;
1580 uint64_t m_light_wallet_unlocked_balance;
1583 std::unordered_map<crypto::hash, address_tx> m_light_wallet_address_txs;
1585 std::unordered_map<crypto::public_key, std::map<uint64_t, crypto::key_image> > m_key_image_cache;
1588 bool m_ring_history_saved;
1589 std::unique_ptr<ringdb> m_ringdb;
1590 boost::optional<crypto::chacha_key> m_ringdb_key;
1593 std::unique_ptr<tools::file_locker> m_keys_file_locker;
1596 bool m_original_keys_available;
1600 crypto::chacha_key m_cache_key;
1601 boost::optional<epee::wipeable_string> m_encrypt_keys_after_refresh;
1604 bool m_devices_registered;
1606 std::shared_ptr<tools::Notify> m_tx_notify;
1607 std::unique_ptr<wallet_device_callback> m_device_callback;
1609 bool m_display_progress_indicator;
1635 template <
class Archive>
1639 template <
class Archive>
1683 template <
class Archive>
1782 template <
class Archive>
1789 template <
class Archive>
1797 template <
class Archive>
1804 template <
class Archive>
1853 template <
class Archive>
1883 if (!
typename Archive::is_saving())
1903 template <
class Archive>
1935 template <
class Archive>
1943 template <
class Archive>
1957 template <
class Archive>
1968 template <
class Archive>
1975 template <
class Archive>
1985 template <
class Archive>
1994 std::list<size_t> selected_transfers;
1995 a & selected_transfers;
1998 for (
size_t t: selected_transfers)
2014 if (!
typename Archive::is_saving())
2021 if (!
typename Archive::is_saving())
2028 a & use_bulletproofs;
2029 if (!
typename Archive::is_saving())
2036 template <
class Archive>
2046 template <
class Archive>
2057 std::list<size_t> selected_transfers;
2058 a & selected_transfers;
2061 for (
size_t t: selected_transfers)
2089 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2091 splitted_dsts.clear();
2097 [&](
uint64_t chunk) { splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, de.addr, de.is_subaddress)); },
2098 [&](
uint64_t a_dust) { splitted_dsts.push_back(cryptonote::tx_destination_entry(a_dust, de.addr, de.is_subaddress)); } );
2103 if (chunk <= dust_threshold)
2104 dust_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, change_dst.is_subaddress));
2106 splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, change_dst.is_subaddress));
2108 [&](
uint64_t a_dust) { dust_dsts.push_back(cryptonote::tx_destination_entry(a_dust, change_dst.addr, change_dst.is_subaddress)); } );
2113 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2115 splitted_dsts = dsts;
A container for blockchain checkpoints.
std::vector< tx_out > vout
Non-owning sequence of data. Does not deep copy.
BOOST_CLASS_VERSION(nodetool::node_server< cryptonote::t_cryptonote_protocol_handler< tests::proxy_core > >, 1)
#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
std::string message("Message requiring signing")
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)
void decompose_amount_into_digits(uint64_t amount, uint64_t dust_threshold, const chunk_handler_t &chunk_handler, const dust_handler_t &dust_handler)
crypto::hash get_transaction_hash(const transaction &t)
std::string print_etn(uint64_t amount, unsigned int decimal_point)
epee::misc_utils::struct_init< response_t > response
declaration and default definition for the functions used the API
bool invoke_http_json(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref method="GET")
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
bool invoke_http_bin(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref method="GET")
@ e_ssl_support_autodetect
tools::wallet2::tx_construction_data tx_construction_data
mdb_size_t count(MDB_cursor *cur)
error
Tracks LMDB error codes.
version
Supported socks variants.
const GenericPointer< typename T::ValueType > T2 value
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define BEGIN_SERIALIZE_OBJECT()
begins the environment of the DSL \detailed for described the serialization of an object
#define FIELD(f)
tags the field with the variable name and then serializes it
#define END_SERIALIZE()
self-explanatory
unsigned __int64 uint64_t
account_public_address addr
std::vector< output_entry > outputs
std::pair< uint64_t, rct::ctkey > output_entry
size_t real_output_in_tx_index
RangeProofType range_proof_type
crypto::public_key shared_secret
crypto::signature key_image_sig
crypto::signature shared_secret_sig
crypto::key_image key_image
struct hash_func hashes[]