35#include <boost/program_options/options_description.hpp>
36#include <boost/program_options/variables_map.hpp>
37#if BOOST_VERSION >= 107400
38#include <boost/serialization/library_version_type.hpp>
40#include <boost/serialization/list.hpp>
41#include <boost/serialization/vector.hpp>
42#include <boost/serialization/deque.hpp>
43#include <boost/thread/lock_guard.hpp>
76#undef MONERO_DEFAULT_LOG_CATEGORY
77#define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2"
79#define THROW_ON_RPC_RESPONSE_ERROR(r, error, res, method, ...) \
81 handle_payment_changes(res, std::integral_constant<bool, HasCredits<decltype(res)>::Has>()); \
82 throw_on_rpc_response_error(r, error, res.status, method); \
83 THROW_WALLET_EXCEPTION_IF(res.status != CORE_RPC_STATUS_OK, ## __VA_ARGS__); \
86#define THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, err, res, method) \
87 THROW_ON_RPC_RESPONSE_ERROR(r, err, res, method, tools::error::wallet_generic_rpc_error, method, res.status)
89class Serialization_portability_wallet_Test;
110 static constexpr result_type max() {
return std::numeric_limits<result_type>::max(); }
115 std::gamma_distribution<double>
gamma;
145 virtual boost::optional<epee::wipeable_string>
on_get_password(
const char *reason) {
return boost::none; }
207 template <
class t_archive>
231 friend class ::Serialization_portability_wallet_Test;
232 friend class ::wallet_accessor_test;
236 static constexpr const std::chrono::seconds
rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30);
242 RefreshDefault = RefreshOptimizeCoinbase,
246 AskPasswordNever = 0,
247 AskPasswordOnAction = 1,
248 AskPasswordToDecrypt = 2,
252 BackgroundMiningMaybe = 0,
253 BackgroundMiningYes = 1,
254 BackgroundMiningNo = 2,
262 static const char*
tr(
const char*
str);
264 static bool has_testnet_option(
const boost::program_options::variables_map&
vm);
265 static bool has_stagenet_option(
const boost::program_options::variables_map&
vm);
266 static std::string device_name_option(
const boost::program_options::variables_map&
vm);
267 static std::string device_derivation_path_option(
const boost::program_options::variables_map &
vm);
268 static void init_options(boost::program_options::options_description& desc_params);
271 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);
275 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);
278 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);
281 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);
309 FIELD(m_partial_key_images)
321 boost::optional<cryptonote::subaddress_receive_info>
received;
347 std::vector<std::pair<uint64_t, crypto::hash>>
m_uses;
357 return output_public_key;
361 FIELD(m_block_height)
364 FIELD(m_internal_output_index)
365 FIELD(m_global_output_index)
368 FIELD(m_spent_height)
373 FIELD(m_key_image_known)
374 FIELD(m_key_image_request)
376 FIELD(m_subaddr_index)
377 FIELD(m_key_image_partial)
379 FIELD(m_multisig_info)
418 FIELD(m_additional_tx_keys)
447 FIELD(m_subaddr_index)
465 FIELD(m_double_spend_seen)
476 std::vector<cryptonote::tx_destination_entry>
m_dests;
478 enum { pending, pending_not_in_pool, failed } m_state;
482 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
497 FIELD(m_subaddr_indices)
509 std::vector<cryptonote::tx_destination_entry>
m_dests;
515 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
519 m_tx(utd.m_tx), 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) {}
534 FIELD(m_subaddr_indices)
541 std::vector<cryptonote::tx_source_entry>
sources;
550 std::vector<cryptonote::tx_destination_entry>
dests;
557 _use_view_tags = 1 << 1
568 FIELD(selected_transfers)
574 if (!typename Archive<W>::is_saving())
576 FIELD_N(
"use_rct", construction_flags)
577 use_rct = (construction_flags & _use_rct) > 0;
578 use_view_tags = (construction_flags & _use_view_tags) > 0;
582 construction_flags = 0;
584 construction_flags ^= _use_rct;
586 construction_flags ^= _use_view_tags;
588 FIELD_N(
"use_rct", construction_flags)
593 FIELD(subaddr_account)
594 FIELD(subaddr_indices)
604 std::unordered_set<crypto::public_key>
ignore;
643 std::vector<cryptonote::tx_destination_entry>
dests;
654 FIELD(dust_added_to_fee)
656 FIELD(selected_transfers)
659 FIELD(additional_tx_keys)
661 FIELD(construction_data)
668 FIELD(multisig_tx_key_entropy)
676 std::vector<tx_construction_data>
txes;
677 std::tuple<uint64_t, uint64_t, wallet2::transfer_container>
transfers;
678 std::tuple<uint64_t, uint64_t, std::vector<wallet2::exported_transfer_details>>
new_transfers;
685 std::pair<size_t, wallet2::transfer_container> v0_transfers;
687 std::get<0>(transfers) = std::get<0>(v0_transfers);
688 std::get<1>(transfers) = std::get<0>(v0_transfers) + std::get<1>(v0_transfers).size();
689 std::get<2>(transfers) = std::get<1>(v0_transfers);
694 std::pair<size_t, std::vector<wallet2::exported_transfer_details>> v1_transfers;
696 std::get<0>(new_transfers) = std::get<0>(v1_transfers);
697 std::get<1>(new_transfers) = std::get<0>(v1_transfers) + std::get<1>(v1_transfers).size();
698 std::get<2>(new_transfers) = std::get<1>(v1_transfers);
708 std::vector<pending_tx>
ptx;
733 crypto::chacha_iv
iv;
744 crypto::chacha_iv
iv;
767 FIELD(m_is_subaddress)
768 FIELD(m_has_payment_id)
787 FIELD(shared_secret_sig)
798 std::vector<cryptonote::transaction>
txes;
807 std::vector<boost::optional<cryptonote::subaddress_receive_info>>
received;
842 bool two_random =
false,
bool create_address_file =
false);
873 void restore(
const std::string& wallet_,
const epee::wipeable_string& password,
const std::string &device_name,
bool create_address_file =
false);
881 const std::vector<std::string> &kex_messages,
882 const std::uint32_t threshold);
889 const std::vector<std::string> &kex_messages,
890 const bool force_update_use_with_caution =
false);
895 std::string get_multisig_first_kex_msg()
const;
905 size_t import_multisig(std::vector<cryptonote::blobdata>
info);
912 void write_watch_only_wallet(
const std::string& wallet_name,
const epee::wipeable_string& password, std::string &new_keys_filename);
913 void load(
const std::string&
wallet,
const epee::wipeable_string& password,
const std::string& keys_buf =
"",
const std::string& cache_buf =
"");
927 boost::optional<wallet2::keys_file_data> get_keys_file_data(
const epee::wipeable_string& password,
bool watch_only);
933 boost::optional<wallet2::cache_file_data> get_cache_file_data(
const epee::wipeable_string& password);
935 std::string path()
const;
944 void encrypt_keys(
const crypto::chacha_key &
key);
946 void decrypt_keys(
const crypto::chacha_key &
key);
960 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
961 const std::string &proxy =
"",
962 uint64_t upper_transaction_weight_limit = 0,
963 bool trusted_daemon =
true,
965 bool set_daemon(std::string
daemon_address =
"http://localhost:8080",
966 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
bool trusted_daemon =
true,
968 bool set_proxy(
const std::string &
address);
970 void stop() { m_run.store(
false, std::memory_order_relaxed); m_message_store.stop(); }
981 bool is_deterministic()
const;
995 const std::string &get_seed_language()
const;
999 void set_seed_language(
const std::string &language);
1009 std::string get_integrated_address_as_str(
const crypto::hash8& payment_id)
const;
1010 void add_subaddress_account(
const std::string& label);
1013 void add_subaddress(
uint32_t index_major,
const std::string& label);
1023 bool is_deprecated()
const;
1024 void refresh(
bool trusted_daemon);
1025 void refresh(
bool trusted_daemon,
uint64_t start_height,
uint64_t & blocks_fetched);
1026 void refresh(
bool trusted_daemon,
uint64_t start_height,
uint64_t & blocks_fetched,
bool& received_money,
bool check_pool =
true);
1027 bool refresh(
bool trusted_daemon,
uint64_t & blocks_fetched,
bool& received_money,
bool& ok);
1035 bool has_multisig_partial_key_images()
const;
1036 bool has_unknown_key_images()
const;
1040 bool reconnect_device();
1046 std::map<uint32_t, uint64_t> balance_per_subaddress(
uint32_t subaddr_index_major,
bool strict)
const;
1047 std::map<uint32_t, std::pair<uint64_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddress(
uint32_t subaddr_index_major,
bool strict);
1049 uint64_t balance_all(
bool strict)
const;
1051 template<
typename T>
1052 void transfer_selected(
const std::vector<cryptonote::tx_destination_entry>& dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
1053 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs, std::unordered_set<crypto::public_key> &valid_public_keys_cache,
1055 void transfer_selected_rct(std::vector<cryptonote::tx_destination_entry> dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
1056 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs, std::unordered_set<crypto::public_key> &valid_public_keys_cache,
1059 void commit_tx(pending_tx& ptx_vector);
1060 void commit_tx(std::vector<pending_tx>& ptx_vector);
1061 bool save_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename)
const;
1062 std::string dump_tx_to_str(
const std::vector<pending_tx> &ptx_vector)
const;
1063 std::string save_multisig_tx(multisig_tx_set txs);
1064 bool save_multisig_tx(
const multisig_tx_set &txs,
const std::string &filename);
1065 std::string save_multisig_tx(
const std::vector<pending_tx>& ptx_vector);
1066 bool save_multisig_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename);
1067 multisig_tx_set make_multisig_tx_set(
const std::vector<pending_tx>& ptx_vector)
const;
1069 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);
1077 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);
1078 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);
1079 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);
1082 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);
1083 bool sanity_check(
const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts)
const;
1084 void cold_tx_aux_import(
const std::vector<pending_tx>&
ptx,
const std::vector<std::string>& tx_device_aux);
1085 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);
1087 void device_show_address(
uint32_t account_index,
uint32_t address_index,
const boost::optional<crypto::hash8> &payment_id);
1088 bool parse_multisig_tx_from_str(std::string multisig_tx_st, multisig_tx_set &
exported_txs)
const;
1090 bool load_multisig_tx_from_file(
const std::string &filename, multisig_tx_set &
exported_txs, std::function<
bool(
const multisig_tx_set&)> accept_func = NULL);
1091 bool sign_multisig_tx_from_file(
const std::string &filename, std::vector<crypto::hash> &txids, std::function<
bool(
const multisig_tx_set&)> accept_func);
1092 bool sign_multisig_tx(multisig_tx_set &
exported_txs, std::vector<crypto::hash> &txids);
1093 bool sign_multisig_tx_to_file(multisig_tx_set &
exported_txs,
const std::string &filename, std::vector<crypto::hash> &txids);
1094 std::vector<pending_tx> create_unmixable_sweep_transactions();
1095 void discard_unmixable_outputs();
1096 bool check_connection(
uint32_t *
version = NULL,
bool *ssl = NULL,
uint32_t timeout = 200000,
bool *wallet_is_outdated = NULL,
bool *daemon_is_outdated = NULL);
1097 bool check_version(
uint32_t *
version,
bool *wallet_is_outdated,
bool *daemon_is_outdated);
1098 bool check_hard_fork_version(
cryptonote::network_type nettype,
const std::vector<std::pair<uint8_t, uint64_t>> &daemon_hard_forks,
const uint64_t height,
const uint64_t target_height,
bool *wallet_is_outdated,
bool *daemon_is_outdated);
1100 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;
1101 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;
1102 void get_payments_out(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
1103 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;
1104 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;
1105 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;
1108 void rescan_spent();
1109 void rescan_blockchain(
bool hard,
bool refresh =
true,
bool keep_key_images =
false);
1110 bool is_transfer_unlocked(
const transfer_details& td);
1116 std::vector<cryptonote::public_node> get_public_nodes(
bool white_only =
true);
1118 template <
class t_archive>
1128 m_blockchain.clear();
1131 m_blockchain.push_back(
b);
1139 a & m_account_public_address;
1140 a & m_key_images.parent();
1143 a & m_unconfirmed_txs.parent();
1146 a & m_payments.parent();
1149 a & m_tx_keys.parent();
1152 a & m_confirmed_txs.parent();
1155 a & dummy_refresh_height;
1158 a & m_tx_notes.parent();
1164 std::unordered_map<crypto::hash, payment_details> m;
1166 m_unconfirmed_payments.clear();
1167 for (std::unordered_map<crypto::hash, payment_details>::const_iterator i = m.begin(); i != m.end(); ++i)
1168 m_unconfirmed_payments.insert(std::make_pair(i->first,
pool_payment_details{i->second, false}));
1176 for (
size_t i = 0; i < m_transfers.size(); ++i)
1183 a & m_pub_keys.parent();
1192 std::unordered_multimap<crypto::hash, payment_details> m;
1194 m_unconfirmed_payments.clear();
1195 for (
const auto &i: m)
1200 a & m_scanned_pool_txs[0];
1201 a & m_scanned_pool_txs[1];
1204 a & m_subaddresses.parent();
1205 std::unordered_map<cryptonote::subaddress_index, crypto::public_key> dummy_subaddresses_inv;
1206 a & dummy_subaddresses_inv;
1207 a & m_subaddress_labels;
1208 a & m_additional_tx_keys.parent();
1211 a & m_attributes.parent();
1214 a & m_unconfirmed_payments.parent();
1217 a & (std::pair<std::map<std::string, std::string>, std::vector<std::string>>&)m_account_tags;
1220 a & m_ring_history_saved;
1223 a & m_last_block_reward;
1226 a & m_tx_device.parent();
1229 a & m_device_last_key_image_sync;
1232 a & m_cold_key_images.parent();
1235 a & m_rpc_client_secret_key;
1238 m_has_ever_refreshed_from_node =
false;
1241 a & m_has_ever_refreshed_from_node;
1249 FIELD(m_account_public_address)
1251 FIELD(m_unconfirmed_txs)
1254 FIELD(m_confirmed_txs)
1256 FIELD(m_unconfirmed_payments)
1258 FIELD(m_address_book)
1259 FIELD(m_scanned_pool_txs[0])
1260 FIELD(m_scanned_pool_txs[1])
1261 FIELD(m_subaddresses)
1262 FIELD(m_subaddress_labels)
1263 FIELD(m_additional_tx_keys)
1265 FIELD(m_account_tags)
1266 FIELD(m_ring_history_saved)
1267 FIELD(m_last_block_reward)
1269 FIELD(m_device_last_key_image_sync)
1270 FIELD(m_cold_key_images)
1271 FIELD(m_rpc_client_secret_key)
1274 m_has_ever_refreshed_from_node =
false;
1277 FIELD(m_has_ever_refreshed_from_node)
1286 static
void wallet_exists(
const std::
string& file_path,
bool& keys_file_exists,
bool& wallet_file_exists);
1292 static
bool wallet_valid_path_format(
const std::
string& file_path);
1293 static
bool parse_long_payment_id(
const std::
string& payment_id_str,
crypto::hash& payment_id);
1294 static
bool parse_short_payment_id(
const std::
string& payment_id_str,
crypto::hash8& payment_id);
1295 static
bool parse_payment_id(
const std::
string& payment_id_str,
crypto::hash& payment_id);
1297 bool always_confirm_transfers()
const {
return m_always_confirm_transfers; }
1369 void set_tx_key(
const crypto::hash &txid,
const crypto::secret_key &tx_key,
const std::vector<crypto::secret_key> &additional_tx_keys,
const boost::optional<cryptonote::account_public_address> &single_destination_subaddress = boost::none);
1380 std::string get_spend_proof(
const crypto::hash &txid,
const std::string &message);
1381 bool check_spend_proof(
const crypto::hash &txid,
const std::string &message,
const std::string &sig_str);
1383 void scan_tx(
const std::vector<crypto::hash> &txids);
1392 std::string get_reserve_proof(
const boost::optional<std::pair<uint32_t, uint64_t>> &account_minreserve,
const std::string &message);
1410 bool delete_address_book_row(std::size_t row_id);
1414 const transfer_details &get_transfer_details(
size_t idx)
const;
1416 uint8_t get_current_hard_fork();
1419 int get_fee_algorithm();
1421 std::string get_wallet_file()
const;
1422 std::string get_keys_file()
const;
1423 std::string get_daemon_address()
const;
1424 const boost::optional<epee::net_utils::http::login>&
get_daemon_login()
const {
return m_daemon_login; }
1425 uint64_t get_daemon_blockchain_height(std::string& err);
1426 uint64_t get_daemon_blockchain_target_height(std::string& err);
1427 uint64_t get_daemon_adjusted_time();
1432 uint64_t get_approximate_blockchain_height()
const;
1433 uint64_t estimate_blockchain_height();
1434 std::vector<size_t> select_available_outputs_from_histogram(
uint64_t count,
bool atleast,
bool unlocked,
bool allow_rct);
1435 std::vector<size_t> select_available_outputs(
const std::function<
bool(
const transfer_details &td)> &f);
1436 std::vector<size_t> select_available_unmixable_outputs();
1437 std::vector<size_t> select_available_mixable_outputs();
1439 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;
1440 size_t pop_best_value(std::vector<size_t> &unused_dust_indices,
const std::vector<size_t>& selected_transfers,
bool smallest =
false)
const;
1442 void set_tx_note(
const crypto::hash &txid,
const std::string ¬e);
1443 std::string get_tx_note(
const crypto::hash &txid)
const;
1445 void set_tx_device_aux(
const crypto::hash &txid,
const std::string &aux);
1446 std::string get_tx_device_aux(
const crypto::hash &txid)
const;
1448 void set_description(
const std::string &description);
1449 std::string get_description()
const;
1455 const std::pair<serializable_map<std::string, std::string>, std::vector<std::string>>& get_account_tags();
1461 void set_account_tag(
const std::set<uint32_t> &account_indices,
const std::string&
tag);
1467 void set_account_tag_description(
const std::string&
tag,
const std::string& description);
1480 std::string sign_multisig_participant(
const std::string&
data)
const;
1488 bool verify_with_public_key(
const std::string &
data,
const crypto::public_key &public_key,
const std::string &signature)
const;
1491 std::tuple<uint64_t, uint64_t, std::vector<tools::wallet2::exported_transfer_details>> export_outputs(
bool all =
false,
uint32_t start = 0,
uint32_t count = 0xffffffff)
const;
1493 size_t import_outputs(
const std::tuple<
uint64_t,
uint64_t, std::vector<tools::wallet2::exported_transfer_details>> &
outputs);
1494 size_t import_outputs(
const std::tuple<
uint64_t,
uint64_t, std::vector<tools::wallet2::transfer_details>> &
outputs);
1495 size_t import_outputs_from_str(
const std::string &outputs_st);
1498 void import_payments_out(
const std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>> &confirmed_payments);
1499 std::tuple<size_t, crypto::hash, std::vector<crypto::hash>> export_blockchain()
const;
1500 void import_blockchain(
const std::tuple<
size_t,
crypto::hash, std::vector<crypto::hash>> &bc);
1501 bool export_key_images(
const std::string &filename,
bool all =
false)
const;
1502 std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> export_key_images(
bool all =
false)
const;
1503 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);
1505 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);
1506 bool import_key_images(
signed_tx_set & signed_tx,
size_t offset=0,
bool only_selected_transfers=
false);
1509 void update_pool_state(std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &process_txs,
bool refreshed =
false);
1510 void process_pool_state(
const std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &txs);
1511 void remove_obsolete_pool_txs(
const std::vector<crypto::hash> &tx_hashes);
1513 std::string
encrypt(
const char *plaintext,
size_t len,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1517 std::string encrypt_with_view_secret_key(
const std::string &plaintext,
bool authenticated =
true)
const;
1518 template<
typename T=std::
string>
T decrypt(
const std::string &ciphertext,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1519 std::string decrypt_with_view_secret_key(
const std::string &ciphertext,
bool authenticated =
true)
const;
1521 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;
1522 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);
1528 std::vector<std::pair<uint64_t, uint64_t>> estimate_backlog(
const std::vector<std::pair<double, double>> &fee_levels);
1529 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);
1531 uint64_t estimate_fee(
bool use_per_byte_fee,
bool use_rct,
int n_inputs,
int mixin,
int n_outputs,
size_t extra_size,
bool bulletproof,
bool clsag,
bool bulletproof_plus,
bool use_view_tags,
uint64_t base_fee,
uint64_t fee_quantization_mask)
const;
1535 uint64_t get_fee_quantization_mask();
1544 std::pair<size_t, uint64_t> estimate_tx_size_and_weight(
bool use_rct,
int n_inputs,
int ring_size,
int n_outputs,
size_t extra_size);
1546 bool get_rpc_payment_info(
bool mining,
bool &payment_required,
uint64_t &credits,
uint64_t &diff,
uint64_t &credits_per_hash_found,
cryptonote::blobdata &hashing_blob,
uint64_t &height,
uint64_t &seed_height,
crypto::hash &seed_hash,
crypto::hash &next_seed_hash,
uint32_t &cookie);
1547 bool daemon_requires_payment();
1549 bool search_for_rpc_payment(
uint64_t credits_target,
uint32_t n_threads,
const std::function<
bool(
uint64_t,
uint64_t)> &startfunc,
const std::function<
bool(
unsigned)> &contfunc,
const std::function<
bool(
uint64_t)> &foundfunc = NULL,
const std::function<
void(
const std::string&)> &errorfunc = NULL);
1552 m_rpc_payment_state.credits =
res.credits;
1553 if (
res.top_hash != m_rpc_payment_state.top_hash)
1555 m_rpc_payment_state.top_hash =
res.top_hash;
1556 m_rpc_payment_state.stale =
true;
1563 void light_wallet_get_unspent_outs();
1565 void light_wallet_get_address_txs();
1569 bool light_wallet_login(
bool &new_address);
1573 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);
1594 const char*
const ATTRIBUTE_DESCRIPTION =
"wallet2.description";
1595 void set_attribute(
const std::string &
key,
const std::string &
value);
1596 bool get_attribute(
const std::string &
key, std::string &
value)
const;
1602 template<
class t_request,
class t_response>
1603 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 =
"POST")
1605 if (m_offline)
return false;
1606 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1609 template<
class t_request,
class t_response>
1610 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 =
"POST")
1612 if (m_offline)
return false;
1613 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1616 template<
class t_request,
class t_response>
1617 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 =
"POST",
const std::string& req_id =
"0")
1619 if (m_offline)
return false;
1620 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1624 bool set_ring_database(
const std::string &filename);
1628 bool get_rings(
const crypto::chacha_key &
key,
const std::vector<crypto::key_image> &key_images, std::vector<std::vector<uint64_t>> &outs);
1629 bool set_ring(
const crypto::key_image &key_image,
const std::vector<uint64_t> &outs,
bool relative);
1630 bool set_rings(
const std::vector<std::pair<
crypto::key_image, std::vector<uint64_t>>> &rings,
bool relative);
1631 bool unset_ring(
const std::vector<crypto::key_image> &key_images);
1633 bool find_and_save_rings(
bool force =
true);
1635 bool blackball_output(
const std::pair<uint64_t, uint64_t> &output);
1636 bool set_blackballed_outputs(
const std::vector<std::pair<uint64_t, uint64_t>> &
outputs,
bool add =
false);
1637 bool unblackball_output(
const std::pair<uint64_t, uint64_t> &output);
1638 bool is_output_blackballed(
const std::pair<uint64_t, uint64_t> &output)
const;
1640 void freeze(
size_t idx);
1641 void thaw(
size_t idx);
1642 bool frozen(
size_t idx)
const;
1646 bool frozen(
const transfer_details &td)
const;
1648 bool save_to_file(
const std::string& path_to_file,
const std::string& binary,
bool is_printable =
false)
const;
1649 static bool load_from_file(
const std::string& path_to_file, std::string& target_str,
size_t max_size = 1000000000);
1652 uint64_t get_bytes_received()
const;
1659 bool lock_keys_file();
1660 bool unlock_keys_file();
1661 bool is_keys_file_locked()
const;
1665 void set_tx_notify(
const std::shared_ptr<tools::Notify> ¬ify) { m_tx_notify = notify; }
1667 bool is_tx_spendtime_unlocked(
uint64_t unlock_time,
uint64_t block_height);
1669 uint64_t hash_m_transfers(boost::optional<uint64_t> transfer_height,
crypto::hash &hash)
const;
1672 void set_offline(
bool offline =
true);
1676 void credit_report(
uint64_t &expected_spent,
uint64_t &discrepancy)
const { expected_spent = m_rpc_payment_state.expected_spent; discrepancy = m_rpc_payment_state.discrepancy; }
1688 bool store_keys(
const std::string& keys_file_name,
const epee::wipeable_string& password,
bool watch_only =
false);
1701 bool load_keys_buf(
const std::string& keys_buf,
const epee::wipeable_string& password, boost::optional<crypto::chacha_key>& keys_to_encrypt);
1702 void process_new_transaction(
const crypto::hash &txid,
const cryptonote::transaction&
tx,
const std::vector<uint64_t> &o_indices,
uint64_t height,
uint8_t block_version,
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);
1705 void detach_blockchain(
uint64_t height, std::map<std::pair<uint64_t, uint64_t>,
size_t> *output_tracker_cache = NULL);
1706 void get_short_chain_history(std::list<crypto::hash>& ids,
uint64_t granularity = 1)
const;
1708 void clear_soft(
bool keep_key_images=
false);
1709 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,
uint64_t ¤t_height);
1710 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);
1711 void fast_refresh(
uint64_t stop_height,
uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history,
bool force =
false);
1712 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 &last,
bool &error, std::exception_ptr &exception);
1713 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);
1714 uint64_t select_transfers(
uint64_t needed_money, std::vector<size_t> unused_transfers_indices, std::vector<size_t>& selected_transfers)
const;
1715 bool prepare_file_names(
const std::string& file_path);
1720 void check_genesis(
const crypto::hash& genesis_hash)
const;
1721 bool generate_chacha_key_from_secret_keys(crypto::chacha_key &
key)
const;
1724 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;
1725 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;
1726 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;
1728 uint64_t get_upper_transaction_weight_limit();
1729 std::vector<uint64_t> get_unspent_amounts_vector(
bool strict);
1730 uint64_t get_dynamic_base_fee_estimate();
1731 float get_output_relatedness(
const transfer_details &td0,
const transfer_details &td1)
const;
1732 std::vector<size_t> pick_preferred_rct_inputs(
uint64_t needed_money,
uint32_t subaddr_account,
const std::set<uint32_t> &subaddr_indices);
1733 void set_spent(
size_t idx,
uint64_t height);
1734 void set_unspent(
size_t idx);
1735 bool is_spent(
const transfer_details &td,
bool strict =
true)
const;
1736 bool is_spent(
size_t idx,
bool strict =
true)
const;
1737 void get_outs(std::vector<std::vector<get_outs_entry>> &outs,
const std::vector<size_t> &selected_transfers,
size_t fake_outputs_count,
bool rct, std::unordered_set<crypto::public_key> &valid_public_keys_cache);
1738 void get_outs(std::vector<std::vector<get_outs_entry>> &outs,
const std::vector<size_t> &selected_transfers,
size_t fake_outputs_count, std::vector<uint64_t> &rct_offsets, std::unordered_set<crypto::public_key> &valid_public_keys_cache);
1739 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, std::unordered_set<crypto::public_key> &valid_public_keys_cache)
const;
1740 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;
1741 std::vector<size_t> get_only_rct(
const std::vector<size_t> &unused_dust_indices,
const std::vector<size_t> &unused_transfers_indices)
const;
1742 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);
1743 void trim_hashchain();
1745 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;
1747 void get_multisig_k(
size_t idx,
const std::unordered_set<rct::key> &used_L,
rct::key &nonce);
1748 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);
1752 bool get_ring(
const crypto::chacha_key &
key,
const crypto::key_image &key_image, std::vector<uint64_t> &outs);
1753 crypto::chacha_key get_ringdb_key();
1757 void register_devices();
1758 hw::device& lookup_device(
const std::string & device_descriptor);
1760 bool get_rct_distribution(
uint64_t &start_height, std::vector<uint64_t> &distribution);
1762 uint64_t get_segregation_fork_height()
const;
1765 std::shared_ptr<std::map<std::pair<uint64_t, uint64_t>,
size_t>> create_output_tracker_cache()
const;
1768 void setup_new_blockchain();
1769 void create_keys_file(
const std::string &wallet_,
bool watch_only,
const epee::wipeable_string &password,
bool create_address_file);
1773 void on_device_button_pressed();
1774 boost::optional<epee::wipeable_string> on_device_pin_request();
1775 boost::optional<epee::wipeable_string> on_device_passphrase_request(
bool & on_device);
1778 std::string get_rpc_status(
const std::string &
s)
const;
1779 void throw_on_rpc_response_error(
bool r,
const epee::json_rpc::error &error,
const std::string &status,
const char *method)
const;
1781 std::string get_client_signature()
const;
1782 void check_rpc_cost(
const char *
call,
uint64_t post_call_credits,
uint64_t pre_credits,
double expected_cost);
1793 const std::unique_ptr<epee::net_utils::http::abstract_http_client>
m_http_client;
1812 std::pair<serializable_map<std::string, std::string>, std::vector<std::string>>
m_account_tags;
1872 std::unordered_set<crypto::hash> m_scanned_pool_txs[2];
1955 template<
class Archive,
class F,
class S,
class T>
1958 std::tuple<F, S, T> & t,
1961 ar & boost::serialization::make_nvp(
"f", std::get<0>(t));
1962 ar & boost::serialization::make_nvp(
"s", std::get<1>(t));
1963 ar & boost::serialization::make_nvp(
"t", std::get<2>(t));
1966 template <
class Archive>
1970 template <
class Archive>
2014 template <
class Archive>
2113 template <
class Archive>
2120 template <
class Archive>
2128 template <
class Archive>
2135 template <
class Archive>
2184 template <
class Archive>
2214 if (!
typename Archive::is_saving())
2231 template <
class Archive>
2266 template <
class Archive>
2273 template <
class Archive>
2284 bool is_long =
false;
2285 for (
int i = 8; i < 32; ++i)
2286 is_long |= payment_id.data[i];
2289 MWARNING(
"Long payment ID ignored on address book load");
2311 template <
class Archive>
2322 template <
class Archive>
2329 std::pair<size_t, tools::wallet2::transfer_container> old_transfers;
2331 std::get<0>(x.
transfers) = std::get<0>(old_transfers);
2332 std::get<1>(x.
transfers) = std::get<0>(old_transfers) + std::get<1>(old_transfers).size();
2333 std::get<2>(x.
transfers) = std::get<1>(old_transfers);
2336 throw std::runtime_error(
"Boost serialization not supported for newest unsigned_tx_set");
2339 template <
class Archive>
2349 template <
class Archive>
2358 std::list<size_t> selected_transfers;
2359 a & selected_transfers;
2362 for (
size_t t: selected_transfers)
2378 if (!
typename Archive::is_saving())
2385 if (!
typename Archive::is_saving())
2392 a & use_bulletproofs;
2393 if (!
typename Archive::is_saving())
2400 template <
class Archive>
2416 template <
class Archive>
2427 std::list<size_t> selected_transfers;
2428 a & selected_transfers;
2431 for (
size_t t: selected_transfers)
2459 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2461 splitted_dsts.clear();
2467 [&](
uint64_t chunk) { splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, de.addr, de.is_subaddress)); },
2468 [&](
uint64_t a_dust) { splitted_dsts.push_back(cryptonote::tx_destination_entry(a_dust, de.addr, de.is_subaddress)); } );
2473 if (chunk <= dust_threshold)
2474 dust_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, false));
2476 splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, false));
2478 [&](
uint64_t a_dust) { dust_dsts.push_back(cryptonote::tx_destination_entry(a_dust, change_dst.addr, false)); } );
2483 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2485 splitted_dsts = dsts;
2498 std::string indexes;
#define s(x, c)
Definition: aesb.c:47
cryptonote::block b
Definition: block.cpp:40
static boost::multiprecision::uint128_t fees
Definition: blockchain_stats.cpp:58
A container for blockchain checkpoints.
Definition: checkpoints.h:53
Definition: cryptonote_basic.h:171
std::vector< tx_out > vout
Definition: cryptonote_basic.h:179
Definition: cryptonote_basic.h:205
Non-owning sequence of data. Does not deep copy.
Definition: span.h:55
Definition: wipeable_string.h:41
Definition: device.hpp:71
Definition: device.hpp:87
device_type
Definition: device.hpp:104
@ SOFTWARE
Definition: device.hpp:105
Definition: device.hpp:77
Definition: message_store.h:268
Definition: containers.h:49
std::unordered_map< K, V > & parent()
Definition: containers.h:52
Definition: containers.h:71
Definition: wallet_tools.h:52
const uint8_t seed[32]
Definition: code-generator.cpp:37
binary_archive< false > ar
Definition: cold-outputs.cpp:54
crypto::secret_key spendkey
Definition: cold-outputs.cpp:44
size_t n_outputs
Definition: cold-outputs.cpp:56
std::tuple< uint64_t, uint64_t, std::vector< tools::wallet2::transfer_details > > outputs
Definition: cold-outputs.cpp:53
wallet set_subaddress_lookahead(1, 1)
std::vector< tools::wallet2::pending_tx > ptx
Definition: cold-transaction.cpp:56
tools::wallet2::unsigned_tx_set exported_txs
Definition: cold-transaction.cpp:53
#define tr(x)
Definition: common_defines.h:4
#define CORE_RPC_STATUS_PAYMENT_REQUIRED
Definition: core_rpc_server_commands_defs.h:81
#define CORE_RPC_STATUS_OK
Definition: core_rpc_server_commands_defs.h:78
#define FEE_PER_KB
Definition: cryptonote_config.h:69
const char * method_name
Definition: daemon_handler.cpp:55
handler_function * call
Definition: daemon_handler.cpp:56
void * memcpy(void *a, const void *b, size_t c)
Definition: glibc_compat.cpp:16
int * count
Definition: gmock_stress_test.cc:176
const char * res
Definition: hmac_keccak.cpp:42
const char * key
Definition: hmac_keccak.cpp:40
#define const
Definition: ipfrdr.c:80
static void init()
Definition: logging.cpp:38
static MDB_envinfo info
Definition: mdb_load.c:37
static int version
Definition: mdb_load.c:29
static int flags
Definition: mdb_load.c:31
uint32_t address
Definition: getifaddr.c:269
Definition: blockchain.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:1967
Definition: portable_binary_archive.hpp:29
crypto namespace.
Definition: crypto.cpp:60
static constexpr crypto::hash8 null_hash8
Definition: hash.h:93
POD_CLASS signature
Definition: crypto.h:98
const crypto::secret_key null_skey
Definition: crypto.cpp:75
POD_CLASS hash8
Definition: hash.h:51
POD_CLASS key_derivation
Definition: crypto.h:91
POD_CLASS public_key
Definition: crypto.h:64
static constexpr crypto::hash null_hash
Definition: hash.h:92
POD_CLASS key_image
Definition: crypto.h:95
POD_CLASS hash
Definition: hash.h:48
network_type
Definition: cryptonote_config.h:289
@ MAINNET
Definition: cryptonote_config.h:290
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:216
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:1166
crypto::hash get_transaction_hash(const transaction &t)
Definition: cryptonote_format_utils.cpp:1259
std::string blobdata
Definition: blobdatatype.h:39
declaration and default definition for the functions used the API
Definition: expect.cpp:34
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="POST")
Definition: http_abstract_invoke.h:76
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, epee::json_rpc::error &error_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="POST", const std::string &req_id="0")
Definition: http_abstract_invoke.h:110
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="POST")
Definition: http_abstract_invoke.h:42
@ e_ssl_support_autodetect
Definition: multisig.cpp:46
Definition: bulletproofs.cc:64
std::vector< key > keyV
Definition: rctTypes.h:89
std::vector< keyV > keyM
Definition: rctTypes.h:90
@ RangeProofBorromean
Definition: rctTypes.h:299
@ RangeProofBulletproof
Definition: rctTypes.h:299
key identity()
Definition: rctOps.h:73
Definition: binary_utils.h:36
Definition: transfer.py:1
BOOST_CLASS_VERSION(nodetool::peerlist_types, nodetool::CURRENT_PEERLIST_STORAGE_ARCHIVE_VER)
void generate(randomx::Program &p, uint32_t nonce)
Definition: perf-simulation.cpp:62
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
const char *const str
Definition: portlistingparse.c:23
const portMappingElt code
Definition: portlistingparse.c:22
void serialize(Archive &a, unsigned_tx_set &x, const boost::serialization::version_type ver)
Definition: serialization.cpp:884
#define BEGIN_SERIALIZE_OBJECT()
begins the environment of the DSL \detailed for described the serialization of an object
Definition: serialization.h:184
#define FIELD(f)
tags the field with the variable name and then serializes it
Definition: serialization.h:237
#define FIELD_N(t, f)
serializes a field f tagged t
Definition: serialization.h:226
#define VERSION_FIELD(v)
Definition: serialization.h:288
#define MAGIC_FIELD(m)
Definition: serialization.h:277
#define END_SERIALIZE()
self-explanatory
Definition: serialization.h:208
#define VARINT_FIELD(f)
tags and serializes the varint f
Definition: serialization.h:257
static const unsigned char iv[64]
Definition: sha512-hash.c:13
if(!cryptonote::get_account_address_from_str_or_url(info, cryptonote::TESTNET, "9uVsvEryzpN8WH2t1WWhFFCG5tS8cBNdmJYNRuckLENFimfauV5pZKeS1P2CbxGkSDTUPHXWwiYE5ZGSXDAGbaZgDxobqDN"))
Definition: signature.cpp:53
#define ts
Definition: skein.c:522
static __thread int depth
Definition: threadpool.cpp:34
static std::string decrypt(const std::string &ciphertext, const crypto::key_image &key_image, const crypto::chacha_key &key, uint8_t field)
Definition: ringdb.cpp:136
static std::string encrypt(const std::string &plaintext, const crypto::key_image &key_image, const crypto::chacha_key &key, uint8_t field)
Definition: ringdb.cpp:121
#define true
Definition: stdbool.h:36
#define false
Definition: stdbool.h:37
unsigned short uint16_t
Definition: stdint.h:125
signed __int64 int64_t
Definition: stdint.h:135
unsigned int uint32_t
Definition: stdint.h:126
unsigned char uint8_t
Definition: stdint.h:124
unsigned __int64 uint64_t
Definition: stdint.h:136
Definition: argon2_core.h:74
Definition: core_rpc_server_commands_defs.h:191
Definition: cryptonote_basic.h:512
Definition: cryptonote_protocol_defs.h:133
Definition: cryptonote_basic.h:475
Definition: cryptonote_basic.h:539
Definition: subaddress_index.h:39
Definition: cryptonote_tx_utils.h:75
uint64_t amount
Definition: cryptonote_tx_utils.h:77
account_public_address addr
Definition: cryptonote_tx_utils.h:78
Definition: cryptonote_basic.h:158
Definition: cryptonote_tx_utils.h:43
uint64_t amount
Definition: cryptonote_tx_utils.h:51
uint64_t real_output
Definition: cryptonote_tx_utils.h:47
uint64_t real_output_in_tx_index
Definition: cryptonote_tx_utils.h:50
std::vector< output_entry > outputs
Definition: cryptonote_tx_utils.h:46
std::pair< uint64_t, rct::ctkey > output_entry
Definition: cryptonote_tx_utils.h:44
Definition: jsonrpc_structs.h:32
Definition: misc_language.h:104
Definition: minixmlvalid.c:15
Definition: message_store.h:242
Definition: chaingen.h:294
Definition: rctTypes.h:300
RangeProofType range_proof_type
Definition: rctTypes.h:301
Definition: rctTypes.h:79
Definition: rctTypes.h:105
Definition: rctTypes.h:114
Definition: rctTypes.h:595
Definition: wallet2.h:773
crypto::public_key shared_secret
Definition: wallet2.h:776
crypto::signature key_image_sig
Definition: wallet2.h:779
crypto::signature shared_secret_sig
Definition: wallet2.h:778
uint64_t index_in_tx
Definition: wallet2.h:775
crypto::key_image key_image
Definition: wallet2.h:777
crypto::hash txid
Definition: wallet2.h:774
Definition: serialization.cpp:879
#define CRITICAL_REGION_LOCAL(x)
Definition: syncobj.h:153
const char * tag
Definition: testobsdrdr.c:19
std::string data
Definition: base58.cpp:37
struct hash_func hashes[]
randomx_vm * vm
Definition: tests.cpp:20
randomx_cache * cache
Definition: tests.cpp:19
cryptonote::transaction tx
Definition: transaction.cpp:40
string daemon_address
Definition: transfers.cpp:41
static crypto::public_key get_tx_pub_key_from_received_outs(const tools::wallet2::transfer_details &td)
Definition: trezor_tests.cpp:412
static std::string get_payment_id(const std::vector< uint8_t > &tx_extra)
Definition: trezor_tests.cpp:472
static void ready(int code, upnpc_t *p, upnpc_device_t *d, void *data)
Definition: upnpc-libevent.c:40
#define THROW_WALLET_EXCEPTION_IF(cond, err_type,...)
Definition: wallet_errors.h:965