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;
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;
412 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),
413 m_is_sc_migration(
std::any_of(utd.m_dests.begin(), utd.m_dests.end(), [](
422 std::vector<cryptonote::tx_source_entry>
sources;
430 std::vector<cryptonote::tx_destination_entry>
dests;
438 FIELD(selected_transfers)
444 FIELD(subaddr_account)
445 FIELD(subaddr_indices)
455 std::unordered_set<crypto::public_key>
ignore;
474 std::vector<cryptonote::tx_destination_entry>
dests;
483 FIELD(dust_added_to_fee)
485 FIELD(selected_transfers)
488 FIELD(additional_tx_keys)
490 FIELD(construction_data)
499 std::vector<tx_construction_data>
txes;
500 std::pair<size_t, wallet2::transfer_container>
transfers;
505 std::vector<pending_tx>
ptx;
523 crypto::chacha_iv
iv;
534 crypto::chacha_iv
iv;
568 std::vector<cryptonote::transaction>
txes;
577 std::vector<boost::optional<cryptonote::subaddress_receive_info>>
received;
598 bool empty()
const {
return tx_extra_fields.empty() && primary.empty() && additional.empty() && public_outs.empty(); }
599 bool public_only()
const {
return !public_outs.empty() && primary.empty() && additional.empty(); }
624 bool two_random =
false,
bool create_address_file =
false);
663 const std::vector<std::string> &
info,
671 const std::vector<crypto::secret_key> &view_keys,
672 const std::vector<crypto::public_key> &spend_keys,
675 const std::vector<std::string> &
info);
680 std::unordered_set<crypto::public_key> pkeys,
681 std::vector<crypto::public_key> signers);
750 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
751 boost::asio::ip::tcp::endpoint proxy = {},
752 uint64_t upper_transaction_weight_limit = 0,
753 bool trusted_daemon =
true,
757 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
bool trusted_daemon =
true,
760 void stop() { m_run.store(
false, std::memory_order_relaxed); m_message_store.stop(); }
802 size_t get_num_subaddresses(
uint32_t index_major)
const {
return index_major < m_subaddress_labels.size() ? m_subaddress_labels[index_major].size() : 0; }
808 std::pair<size_t, size_t>
get_subaddress_lookahead()
const {
return {m_subaddress_lookahead_major, m_subaddress_lookahead_minor}; }
816 void refresh(
bool trusted_daemon);
818 void refresh(
bool trusted_daemon,
uint64_t start_height,
uint64_t & blocks_fetched,
bool& received_etn,
bool check_pool =
true);
819 bool refresh(
bool trusted_daemon,
uint64_t & blocks_fetched,
bool& received_etn,
bool& ok);
846 void transfer_selected(
const std::vector<cryptonote::tx_destination_entry>& dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
847 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
850 void commit_tx(std::vector<pending_tx>& ptx_vector);
851 bool save_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename)
const;
862 bool sign_tx(
unsigned_tx_set &exported_txs, std::vector<wallet2::pending_tx> &ptx, signed_tx_set &signed_txs);
867 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);
868 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);
869 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);
870 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);
873 bool sanity_check(
const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts)
const;
874 void cold_tx_aux_import(
const std::vector<pending_tx>& ptx,
const std::vector<std::string>& tx_device_aux);
875 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);
881 bool sign_multisig_tx(multisig_tx_set &exported_txs, std::vector<crypto::hash> &txids);
887 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;
888 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;
889 void get_payments_out(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
890 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;
892 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;
894 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;
895 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;
896 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;
909 template <
class t_archive>
917 std::vector<crypto::hash> blockchain;
919 for (
const auto &b: blockchain)
921 m_blockchain.push_back(b);
929 a & m_account_public_address;
933 a & m_unconfirmed_txs;
945 a & dummy_refresh_height;
954 std::unordered_map<crypto::hash, payment_details> m;
956 for (std::unordered_map<crypto::hash, payment_details>::const_iterator i = m.begin(); i != m.end(); ++i)
957 m_unconfirmed_payments.insert(std::make_pair(i->first,
pool_payment_details{i->second, false}));
964 for (
size_t i = 0; i < m_transfers.size(); ++i)
969 m_pub_keys.emplace(o.
key, i);
982 std::unordered_multimap<crypto::hash, payment_details> m;
984 for (
const auto &i: m)
989 a & m_scanned_pool_txs[0];
990 a & m_scanned_pool_txs[1];
994 std::unordered_map<cryptonote::subaddress_index, crypto::public_key> dummy_subaddresses_inv;
995 a & dummy_subaddresses_inv;
996 a & m_subaddress_labels;
997 a & m_additional_tx_keys;
1003 a & m_unconfirmed_payments;
1009 a & m_ring_history_saved;
1012 a & m_last_block_reward;
1018 a & m_device_last_key_image_sync;
1021 a & m_cold_key_images;
1024 a & m_chainstate_indexes;
1042 if (ts < 1234567890)
1052 uint64_t diff = ts > now ? ts - now : now - ts;
1054 strftime(buffer,
sizeof(buffer),
"%Y-%m-%d", &tm);
1056 strftime(buffer,
sizeof(buffer),
"%I:%M:%S %p", &tm);
1165 const boost::optional<epee::net_utils::http::login>&
get_daemon_login()
const {
return m_daemon_login; }
1178 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;
1179 size_t pop_best_value(std::vector<size_t> &unused_dust_indices,
const std::vector<size_t>& selected_transfers,
bool smallest =
false)
const;
1194 const std::pair<std::map<std::string, std::string>, std::vector<std::string>>&
get_account_tags();
1228 std::pair<size_t, std::vector<tools::wallet2::transfer_details>>
export_outputs(
bool all =
false)
const;
1230 size_t import_outputs(
const std::pair<
size_t, std::vector<tools::wallet2::transfer_details>> &outputs);
1234 void import_payments_out(
const std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>> &confirmed_payments);
1235 std::tuple<size_t, crypto::hash, std::vector<crypto::hash>>
export_blockchain()
const;
1238 std::pair<size_t, std::vector<std::pair<crypto::key_image, crypto::signature>>>
export_key_images(
bool all =
false)
const;
1241 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);
1242 bool import_key_images(signed_tx_set & signed_tx,
size_t offset=0,
bool only_selected_transfers=
false);
1263 std::vector<std::pair<uint64_t, uint64_t>>
estimate_backlog(
const std::vector<std::pair<double, double>> &fee_levels);
1288 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);
1318 template<
class t_request,
class t_response>
1319 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")
1321 if (m_offline)
return false;
1322 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1325 template<
class t_request,
class t_response>
1326 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")
1328 if (m_offline)
return false;
1329 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1332 template<
class t_request,
class t_response>
1335 if (m_offline)
return false;
1336 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1345 bool unset_ring(
const std::vector<crypto::key_image> &key_images);
1355 void thaw(
size_t idx);
1356 bool frozen(
size_t idx)
const;
1360 bool frozen(
const transfer_details &td)
const;
1377 void set_tx_notify(
const std::shared_ptr<tools::Notify> ¬ify) { m_tx_notify = notify; }
1401 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);
1403 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);
1404 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);
1405 void get_short_chain_history(std::list<crypto::hash>& ids,
uint64_t granularity = 1)
const;
1407 void clear_soft(
bool keep_key_images=
false);
1408 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);
1409 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);
1410 void fast_refresh(
uint64_t stop_height,
uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history,
bool force =
false);
1411 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);
1412 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);
1413 uint64_t select_transfers(
uint64_t needed_etn, std::vector<size_t> unused_transfers_indices, std::vector<size_t>& selected_transfers)
const;
1414 bool prepare_file_names(
const std::string& file_path);
1419 void check_genesis(
const crypto::hash& genesis_hash)
const;
1420 bool generate_chacha_key_from_secret_keys(crypto::chacha_key &
key)
const;
1422 crypto::hash get_payment_id(
const pending_tx &ptx)
const;
1423 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;
1424 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;
1425 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;
1427 uint64_t get_upper_transaction_weight_limit()
const;
1428 std::vector<uint64_t> get_unspent_amounts_vector()
const;
1429 uint64_t get_dynamic_base_fee_estimate()
const;
1430 float get_output_relatedness(
const transfer_details &td0,
const transfer_details &td1)
const;
1431 std::vector<size_t> pick_preferred_rct_inputs(
uint64_t needed_etn,
uint32_t subaddr_account,
const std::set<uint32_t> &subaddr_indices)
const;
1432 void set_spent(
size_t idx,
uint64_t height,
bool public_out =
false);
1433 void set_unspent(
size_t idx,
bool public_out =
false);
1434 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);
1435 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;
1436 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;
1437 std::vector<size_t> get_only_rct(
const std::vector<size_t> &unused_dust_indices,
const std::vector<size_t> &unused_transfers_indices)
const;
1438 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);
1439 void trim_hashchain();
1441 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;
1443 rct::key get_multisig_k(
size_t idx,
const std::unordered_set<rct::key> &used_L)
const;
1444 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);
1449 crypto::chacha_key get_ringdb_key();
1453 void register_devices();
1456 bool get_rct_distribution(
uint64_t &start_height, std::vector<uint64_t> &distribution);
1458 uint64_t get_segregation_fork_height()
const;
1459 void unpack_multisig_info(
const std::vector<std::string>&
info,
1460 std::vector<crypto::public_key> &public_keys,
1461 std::vector<crypto::secret_key> &secret_keys)
const;
1462 bool unpack_extra_multisig_info(
const std::vector<std::string>&
info,
1463 std::vector<crypto::public_key> &signers,
1464 std::unordered_set<crypto::public_key> &pkeys)
const;
1469 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;
1472 void setup_new_blockchain();
1476 void on_device_button_request(
uint64_t code);
1477 void on_device_button_pressed();
1478 boost::optional<epee::wipeable_string> on_device_pin_request();
1479 boost::optional<epee::wipeable_string> on_device_passphrase_request(
bool on_device);
1483 void throw_on_rpc_response_error(
const boost::optional<std::string> &status,
const char *method)
const;
1489 boost::optional<epee::net_utils::http::login> m_daemon_login;
1496 std::unordered_map<crypto::hash, unconfirmed_transfer_details> m_unconfirmed_txs;
1497 std::unordered_map<crypto::hash, confirmed_transfer_details> m_confirmed_txs;
1498 std::unordered_multimap<crypto::hash, pool_payment_details> m_unconfirmed_payments;
1499 std::unordered_map<crypto::hash, crypto::secret_key> m_tx_keys;
1501 uint64_t fallback_to_pow_checkpoint_height;
1503 std::unordered_map<crypto::hash, std::vector<crypto::secret_key>> m_additional_tx_keys;
1507 std::unordered_map<crypto::key_image, size_t> m_key_images;
1508 std::unordered_map<crypto::public_key, size_t> m_pub_keys;
1509 std::unordered_map<std::pair<crypto::hash, size_t>, size_t, boost::hash<std::pair<crypto::hash, size_t>>> m_chainstate_indexes;
1511 std::unordered_map<crypto::public_key, cryptonote::subaddress_index> m_subaddresses;
1512 std::vector<std::vector<std::string>> m_subaddress_labels;
1513 std::unordered_map<crypto::hash, std::string> m_tx_notes;
1514 std::unordered_map<std::string, std::string> m_attributes;
1515 std::vector<tools::wallet2::address_book_row> m_address_book;
1516 std::pair<std::map<std::string, std::string>, std::vector<std::string>> m_account_tags;
1517 uint64_t m_upper_transaction_weight_limit;
1518 const std::vector<std::vector<tools::wallet2::multisig_info>> *m_multisig_rescan_info;
1519 const std::vector<std::vector<rct::key>> *m_multisig_rescan_k;
1520 std::unordered_map<crypto::public_key, crypto::key_image> m_cold_key_images;
1522 std::atomic<bool> m_run;
1524 boost::recursive_mutex m_daemon_rpc_mutex;
1526 bool m_trusted_daemon;
1532 bool is_old_file_format;
1536 std::vector<crypto::public_key> m_multisig_signers;
1539 std::vector<crypto::public_key> m_multisig_derivations;
1540 bool m_always_confirm_transfers;
1541 bool m_print_ring_members;
1542 bool m_store_tx_info;
1546 bool m_auto_refresh;
1547 bool m_first_refresh_done;
1548 uint64_t m_refresh_from_block_height;
1551 bool m_explicit_refresh_from_block_height;
1552 bool m_confirm_missing_payment_id;
1553 bool m_confirm_non_default_ring_size;
1557 bool m_merge_destinations;
1558 bool m_confirm_backlog;
1559 uint32_t m_confirm_backlog_threshold;
1560 bool m_confirm_export_overwrite;
1561 bool m_auto_low_priority;
1562 bool m_segregate_pre_fork_outputs;
1563 bool m_key_reuse_mitigation2;
1565 bool m_ignore_fractional_outputs;
1568 bool m_is_initialized;
1570 std::unordered_set<crypto::hash> m_scanned_pool_txs[2];
1571 size_t m_subaddress_lookahead_major, m_subaddress_lookahead_minor;
1574 uint64_t m_device_last_key_image_sync;
1579 std::unordered_map<crypto::hash, std::string> m_tx_device;
1582 bool m_light_wallet;
1583 uint64_t m_light_wallet_scanned_block_height;
1584 uint64_t m_light_wallet_blockchain_height;
1586 bool m_light_wallet_connected;
1588 uint64_t m_light_wallet_unlocked_balance;
1591 std::unordered_map<crypto::hash, address_tx> m_light_wallet_address_txs;
1593 std::unordered_map<crypto::public_key, std::map<uint64_t, crypto::key_image> > m_key_image_cache;
1596 bool m_ring_history_saved;
1597 std::unique_ptr<ringdb> m_ringdb;
1598 boost::optional<crypto::chacha_key> m_ringdb_key;
1601 std::unique_ptr<tools::file_locker> m_keys_file_locker;
1604 bool m_original_keys_available;
1608 crypto::chacha_key m_cache_key;
1609 boost::optional<epee::wipeable_string> m_encrypt_keys_after_refresh;
1612 bool m_devices_registered;
1614 std::shared_ptr<tools::Notify> m_tx_notify;
1615 std::unique_ptr<wallet_device_callback> m_device_callback;
1617 bool m_display_progress_indicator;
1643 template <
class Archive>
1647 template <
class Archive>
1691 template <
class Archive>
1790 template <
class Archive>
1797 template <
class Archive>
1805 template <
class Archive>
1812 template <
class Archive>
1861 template <
class Archive>
1891 if (!
typename Archive::is_saving())
1914 template <
class Archive>
1946 template <
class Archive>
1954 template <
class Archive>
1968 template <
class Archive>
1979 template <
class Archive>
1986 template <
class Archive>
1996 template <
class Archive>
2005 std::list<size_t> selected_transfers;
2006 a & selected_transfers;
2009 for (
size_t t: selected_transfers)
2025 if (!
typename Archive::is_saving())
2032 if (!
typename Archive::is_saving())
2039 a & use_bulletproofs;
2040 if (!
typename Archive::is_saving())
2047 template <
class Archive>
2057 template <
class Archive>
2068 std::list<size_t> selected_transfers;
2069 a & selected_transfers;
2072 for (
size_t t: selected_transfers)
2100 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2102 splitted_dsts.clear();
2108 [&](
uint64_t chunk) { splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, de.addr, de.is_subaddress)); },
2109 [&](
uint64_t a_dust) { splitted_dsts.push_back(cryptonote::tx_destination_entry(a_dust, de.addr, de.is_subaddress)); } );
2114 if (chunk <= dust_threshold)
2115 dust_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, change_dst.is_subaddress));
2117 splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, change_dst.is_subaddress));
2119 [&](
uint64_t a_dust) { dust_dsts.push_back(cryptonote::tx_destination_entry(a_dust, change_dst.addr, change_dst.is_subaddress)); } );
2124 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2126 splitted_dsts = dsts;
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")
crypto::public_key shared_secret
CXA_THROW_INFO_T void(* dest)(void *))
epee::misc_utils::struct_init< response_t > response
std::string print_etn(uint64_t amount, unsigned int decimal_point)
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")
void decompose_amount_into_digits(uint64_t amount, uint64_t dust_threshold, const chunk_handler_t &chunk_handler, const dust_handler_t &dust_handler)
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")
Non-owning sequence of data. Does not deep copy.
struct hash_func hashes[]
#define END_SERIALIZE()
self-explanatory
std::vector< tx_out > vout
Holds cryptonote related classes and helpers.
mdb_size_t count(MDB_cursor *cur)
declaration and default definition for the functions used the API
#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
unsigned __int64 uint64_t
#define BEGIN_SERIALIZE_OBJECT()
begins the environment of the DSL for described the serialization of an object
BOOST_CLASS_VERSION(nodetool::node_server< cryptonote::t_cryptonote_protocol_handler< tests::proxy_core > >, 1)
tools::wallet2::tx_construction_data tx_construction_data
version
Supported socks variants.
std::string message("Message requiring signing")
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
account_public_address addr
crypto::signature shared_secret_sig
const GenericPointer< typename T::ValueType > T2 value
size_t real_output_in_tx_index
crypto::hash get_transaction_hash(const transaction &t)
std::vector< output_entry > outputs
crypto::signature key_image_sig
RangeProofType range_proof_type
A container for blockchain checkpoints.
std::string to_string(t_connection_type type)
crypto::key_image key_image
std::pair< uint64_t, rct::ctkey > output_entry
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)
#define FIELD(f)
tags the field with the variable name and then serializes it
error
Tracks LMDB error codes.