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>
47 #include "include_base_utils.h"
52 #include "storages/http_abstract_invoke.h"
75 #undef MONERO_DEFAULT_LOG_CATEGORY
76 #define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2"
78 #define THROW_ON_RPC_RESPONSE_ERROR(r, error, res, method, ...) \
80 handle_payment_changes(res, std::integral_constant<bool, HasCredits<decltype(res)>::Has>()); \
81 throw_on_rpc_response_error(r, error, res.status, method); \
82 THROW_WALLET_EXCEPTION_IF(res.status != CORE_RPC_STATUS_OK, ## __VA_ARGS__); \
85 #define THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, err, res, method) \
86 THROW_ON_RPC_RESPONSE_ERROR(r, err, res, method, tools::error::wallet_generic_rpc_error, method, res.status)
88 class Serialization_portability_wallet_Test;
89 class wallet_accessor_test;
109 static constexpr
result_type max() {
return std::numeric_limits<result_type>::max(); }
114 std::gamma_distribution<double>
gamma;
144 virtual boost::optional<epee::wipeable_string>
on_get_password(
const char *reason) {
return boost::none; }
206 template <
class t_archive>
230 friend class ::Serialization_portability_wallet_Test;
231 friend class ::wallet_accessor_test;
235 static constexpr
const std::chrono::seconds
rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30);
241 RefreshDefault = RefreshOptimizeCoinbase,
245 AskPasswordNever = 0,
246 AskPasswordOnAction = 1,
247 AskPasswordToDecrypt = 2,
251 BackgroundMiningMaybe = 0,
252 BackgroundMiningYes = 1,
253 BackgroundMiningNo = 2,
261 static const char*
tr(
const char* str);
263 static bool has_testnet_option(
const boost::program_options::variables_map& vm);
264 static bool has_stagenet_option(
const boost::program_options::variables_map& vm);
265 static std::string device_name_option(
const boost::program_options::variables_map& vm);
266 static std::string device_derivation_path_option(
const boost::program_options::variables_map &vm);
267 static void init_options(boost::program_options::options_description& desc_params);
270 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);
274 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);
277 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);
280 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);
282 static bool verify_password(
const std::string& keys_file_name,
const epee::wipeable_string& password,
bool no_spend_key,
hw::device &hwdev, uint64_t kdf_rounds);
283 static bool query_device(
hw::device::device_type& device_type,
const std::string& keys_file_name,
const epee::wipeable_string& password, uint64_t kdf_rounds = 1);
308 FIELD(m_partial_key_images)
320 boost::optional<cryptonote::subaddress_receive_info>
received;
346 std::vector<std::pair<uint64_t, crypto::hash>>
m_uses;
349 uint64_t
amount()
const {
return m_amount; }
353 FIELD(m_block_height)
356 FIELD(m_internal_output_index)
357 FIELD(m_global_output_index)
360 FIELD(m_spent_height)
365 FIELD(m_key_image_known)
366 FIELD(m_key_image_request)
368 FIELD(m_subaddr_index)
369 FIELD(m_key_image_partial)
371 FIELD(m_multisig_info)
399 FIELD(m_subaddr_index)
417 FIELD(m_double_spend_seen)
428 std::vector<cryptonote::tx_destination_entry>
m_dests;
430 enum { pending, pending_not_in_pool, failed } m_state;
434 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
449 FIELD(m_subaddr_indices)
460 std::vector<cryptonote::tx_destination_entry>
m_dests;
466 std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>>
m_rings;
470 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) {}
483 FIELD(m_subaddr_indices)
490 std::vector<cryptonote::tx_source_entry>
sources;
498 std::vector<cryptonote::tx_destination_entry>
dests;
506 FIELD(selected_transfers)
512 FIELD(subaddr_account)
513 FIELD(subaddr_indices)
523 std::unordered_set<crypto::public_key>
ignore;
551 std::vector<cryptonote::tx_destination_entry>
dests;
560 FIELD(dust_added_to_fee)
562 FIELD(selected_transfers)
565 FIELD(additional_tx_keys)
567 FIELD(construction_data)
576 std::vector<tx_construction_data>
txes;
577 std::pair<size_t, wallet2::transfer_container>
transfers;
588 std::vector<pending_tx>
ptx;
613 crypto::chacha_iv
iv;
624 crypto::chacha_iv
iv;
647 FIELD(m_is_subaddress)
648 FIELD(m_has_payment_id)
667 FIELD(shared_secret_sig)
678 std::vector<cryptonote::transaction>
txes;
687 std::vector<boost::optional<cryptonote::subaddress_receive_info>>
received;
696 bool empty()
const {
return tx_extra_fields.empty() && primary.empty() && additional.empty(); }
706 void generate(
const std::string& wallet_,
const epee::wipeable_string& password,
707 const epee::wipeable_string& multisig_data,
bool create_address_file =
false);
719 crypto::secret_key generate(
const std::string& wallet,
const epee::wipeable_string& password,
721 bool two_random =
false,
bool create_address_file =
false);
731 void generate(
const std::string& wallet,
const epee::wipeable_string& password,
742 void generate(
const std::string& wallet,
const epee::wipeable_string& password,
752 void restore(
const std::string& wallet_,
const epee::wipeable_string& password,
const std::string &device_name,
bool create_address_file =
false);
759 std::string make_multisig(
const epee::wipeable_string &password,
760 const std::vector<std::string> &
info,
767 std::string make_multisig(
const epee::wipeable_string &password,
768 const std::vector<crypto::secret_key> &view_keys,
769 const std::vector<crypto::public_key> &spend_keys,
771 std::string exchange_multisig_keys(
const epee::wipeable_string &password,
772 const std::vector<std::string> &
info);
776 std::string exchange_multisig_keys(
const epee::wipeable_string &password,
777 std::unordered_set<crypto::public_key> pkeys,
778 std::vector<crypto::public_key> signers);
782 bool finalize_multisig(
const epee::wipeable_string &password,
const std::vector<std::string> &
info);
786 bool finalize_multisig(
const epee::wipeable_string &password,
const std::unordered_set<crypto::public_key> &pkeys, std::vector<crypto::public_key> signers);
790 std::string get_multisig_info()
const;
798 static bool verify_extra_multisig_info(
const std::string &data, std::unordered_set<crypto::public_key> &pkeys,
crypto::public_key &signer);
808 size_t import_multisig(std::vector<cryptonote::blobdata>
info);
814 void rewrite(
const std::string& wallet_name,
const epee::wipeable_string& password);
815 void write_watch_only_wallet(
const std::string& wallet_name,
const epee::wipeable_string& password, std::string &new_keys_filename);
816 void load(
const std::string& wallet,
const epee::wipeable_string& password,
const std::string& keys_buf =
"",
const std::string& cache_buf =
"");
823 void store_to(
const std::string &path,
const epee::wipeable_string &password);
830 boost::optional<wallet2::keys_file_data> get_keys_file_data(
const epee::wipeable_string& password,
bool watch_only);
836 boost::optional<wallet2::cache_file_data> get_cache_file_data(
const epee::wipeable_string& password);
838 std::string path()
const;
843 bool verify_password(
const epee::wipeable_string& password);
847 void encrypt_keys(
const crypto::chacha_key &key);
848 void encrypt_keys(
const epee::wipeable_string &password);
849 void decrypt_keys(
const crypto::chacha_key &key);
850 void decrypt_keys(
const epee::wipeable_string &password);
859 bool init(std::string daemon_address =
"http://localhost:8080",
860 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
861 const std::string &proxy =
"",
862 uint64_t upper_transaction_weight_limit = 0,
863 bool trusted_daemon =
true,
864 epee::net_utils::ssl_options_t ssl_options = epee::net_utils::ssl_support_t::e_ssl_support_autodetect);
865 bool set_daemon(std::string daemon_address =
"http://localhost:8080",
866 boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
bool trusted_daemon =
true,
867 epee::net_utils::ssl_options_t ssl_options = epee::net_utils::ssl_support_t::e_ssl_support_autodetect);
868 bool set_proxy(
const std::string &address);
870 void stop() { m_run.store(
false, std::memory_order_relaxed); m_message_store.stop(); }
881 bool is_deterministic()
const;
882 bool get_seed(epee::wipeable_string& electrum_words,
const epee::wipeable_string &passphrase = epee::wipeable_string())
const;
895 const std::string &get_seed_language()
const;
899 void set_seed_language(
const std::string &language);
909 std::string get_integrated_address_as_str(
const crypto::hash8& payment_id)
const;
910 void add_subaddress_account(
const std::string& label);
912 size_t get_num_subaddresses(uint32_t index_major)
const {
return index_major < m_subaddress_labels.size() ? m_subaddress_labels[index_major].size() : 0; }
913 void add_subaddress(uint32_t index_major,
const std::string& label);
918 void set_subaddress_lookahead(
size_t major,
size_t minor);
919 std::pair<size_t, size_t>
get_subaddress_lookahead()
const {
return {m_subaddress_lookahead_major, m_subaddress_lookahead_minor}; }
923 bool is_deprecated()
const;
924 void refresh(
bool trusted_daemon);
925 void refresh(
bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched);
926 void refresh(
bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched,
bool& received_money,
bool check_pool =
true);
927 bool refresh(
bool trusted_daemon, uint64_t & blocks_fetched,
bool& received_money,
bool& ok);
934 bool multisig(
bool *ready = NULL, uint32_t *threshold = NULL, uint32_t *total = NULL)
const;
935 bool has_multisig_partial_key_images()
const;
936 bool has_unknown_key_images()
const;
937 bool get_multisig_seed(epee::wipeable_string& seed,
const epee::wipeable_string &passphrase = std::string(),
bool raw =
true)
const;
938 bool key_on_device()
const {
return get_device_type() != hw::device::device_type::SOFTWARE; }
940 bool reconnect_device();
943 uint64_t balance(uint32_t subaddr_index_major,
bool strict)
const;
944 uint64_t unlocked_balance(uint32_t subaddr_index_major,
bool strict, uint64_t *blocks_to_unlock = NULL, uint64_t *time_to_unlock = NULL);
946 std::map<uint32_t, uint64_t> balance_per_subaddress(uint32_t subaddr_index_major,
bool strict)
const;
947 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);
949 uint64_t balance_all(
bool strict)
const;
950 uint64_t unlocked_balance_all(
bool strict, uint64_t *blocks_to_unlock = NULL, uint64_t *time_to_unlock = NULL);
952 void transfer_selected(
const std::vector<cryptonote::tx_destination_entry>& dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
953 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
955 void transfer_selected_rct(std::vector<cryptonote::tx_destination_entry> dsts,
const std::vector<size_t>& selected_transfers,
size_t fake_outputs_count,
956 std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
960 void commit_tx(std::vector<pending_tx>& ptx_vector);
961 bool save_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename)
const;
962 std::string dump_tx_to_str(
const std::vector<pending_tx> &ptx_vector)
const;
964 bool save_multisig_tx(
const multisig_tx_set &txs,
const std::string &filename);
965 std::string save_multisig_tx(
const std::vector<pending_tx>& ptx_vector);
966 bool save_multisig_tx(
const std::vector<pending_tx>& ptx_vector,
const std::string &filename);
967 multisig_tx_set make_multisig_tx_set(
const std::vector<pending_tx>& ptx_vector)
const;
969 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);
971 bool sign_tx(
unsigned_tx_set &exported_txs,
const std::string &signed_filename, std::vector<wallet2::pending_tx> &ptx,
bool export_raw =
false);
975 bool load_unsigned_tx(
const std::string &unsigned_filename,
unsigned_tx_set &exported_txs)
const;
976 bool parse_unsigned_tx_from_str(
const std::string &unsigned_tx_st,
unsigned_tx_set &exported_txs)
const;
977 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);
978 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);
979 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);
980 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);
981 std::vector<wallet2::pending_tx> create_transactions_single(
const crypto::key_image &ki,
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);
982 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);
983 bool sanity_check(
const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts)
const;
984 void cold_tx_aux_import(
const std::vector<pending_tx>& ptx,
const std::vector<std::string>& tx_device_aux);
985 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);
986 uint64_t cold_key_image_sync(uint64_t &spent, uint64_t &unspent);
987 void device_show_address(uint32_t account_index, uint32_t address_index,
const boost::optional<crypto::hash8> &payment_id);
988 bool parse_multisig_tx_from_str(std::string multisig_tx_st,
multisig_tx_set &exported_txs)
const;
990 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);
991 bool sign_multisig_tx_from_file(
const std::string &filename, std::vector<crypto::hash> &txids, std::function<
bool(
const multisig_tx_set&)> accept_func);
992 bool sign_multisig_tx(
multisig_tx_set &exported_txs, std::vector<crypto::hash> &txids);
993 bool sign_multisig_tx_to_file(
multisig_tx_set &exported_txs,
const std::string &filename, std::vector<crypto::hash> &txids);
994 std::vector<pending_tx> create_unmixable_sweep_transactions();
995 void discard_unmixable_outputs();
996 bool check_connection(uint32_t *
version = NULL,
bool *ssl = NULL, uint32_t timeout = 200000);
998 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;
999 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;
1000 void get_payments_out(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
1001 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;
1002 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;
1003 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;
1006 void rescan_spent();
1007 void rescan_blockchain(
bool hard,
bool refresh =
true,
bool keep_key_images =
false);
1008 bool is_transfer_unlocked(
const transfer_details& td);
1009 bool is_transfer_unlocked(uint64_t unlock_time, uint64_t block_height);
1014 std::vector<cryptonote::public_node> get_public_nodes(
bool white_only =
true);
1016 template <
class t_archive>
1019 uint64_t dummy_refresh_height = 0;
1024 std::vector<crypto::hash> blockchain;
1027 for (
const auto &
b: blockchain)
1037 a & m_account_public_address;
1038 a & m_key_images.parent();
1041 a & m_unconfirmed_txs.parent();
1044 a & m_payments.parent();
1047 a & m_tx_keys.parent();
1050 a & m_confirmed_txs.parent();
1053 a & dummy_refresh_height;
1056 a & m_tx_notes.parent();
1062 std::unordered_map<crypto::hash, payment_details> m;
1064 m_unconfirmed_payments.clear();
1065 for (std::unordered_map<crypto::hash, payment_details>::const_iterator i = m.begin(); i != m.end(); ++i)
1066 m_unconfirmed_payments.insert(std::make_pair(i->first,
pool_payment_details{i->second, false}));
1074 for (
size_t i = 0; i < m_transfers.size(); ++i)
1079 m_pub_keys.emplace(o.
key, i);
1083 a & m_pub_keys.parent();
1092 std::unordered_multimap<crypto::hash, payment_details> m;
1094 m_unconfirmed_payments.clear();
1095 for (
const auto &i: m)
1100 a & m_scanned_pool_txs[0];
1101 a & m_scanned_pool_txs[1];
1104 a & m_subaddresses.parent();
1105 std::unordered_map<cryptonote::subaddress_index, crypto::public_key> dummy_subaddresses_inv;
1106 a & dummy_subaddresses_inv;
1107 a & m_subaddress_labels;
1108 a & m_additional_tx_keys.parent();
1111 a & m_attributes.parent();
1114 a & m_unconfirmed_payments.parent();
1117 a & (std::pair<std::map<std::string, std::string>, std::vector<std::string>>&)m_account_tags;
1120 a & m_ring_history_saved;
1123 a & m_last_block_reward;
1126 a & m_tx_device.parent();
1129 a & m_device_last_key_image_sync;
1132 a & m_cold_key_images.parent();
1135 a & m_rpc_client_secret_key;
1143 FIELD(m_account_public_address)
1145 FIELD(m_unconfirmed_txs)
1148 FIELD(m_confirmed_txs)
1150 FIELD(m_unconfirmed_payments)
1152 FIELD(m_address_book)
1153 FIELD(m_scanned_pool_txs[0])
1154 FIELD(m_scanned_pool_txs[1])
1155 FIELD(m_subaddresses)
1156 FIELD(m_subaddress_labels)
1157 FIELD(m_additional_tx_keys)
1159 FIELD(m_account_tags)
1160 FIELD(m_ring_history_saved)
1161 FIELD(m_last_block_reward)
1163 FIELD(m_device_last_key_image_sync)
1164 FIELD(m_cold_key_images)
1165 FIELD(m_rpc_client_secret_key)
1174 static
void wallet_exists(
const std::
string& file_path,
bool& keys_file_exists,
bool& wallet_file_exists);
1180 static
bool wallet_valid_path_format(
const std::
string& file_path);
1181 static
bool parse_long_payment_id(
const std::
string& payment_id_str,
crypto::
hash& payment_id);
1182 static
bool parse_short_payment_id(
const std::
string& payment_id_str,
crypto::
hash8& payment_id);
1183 static
bool parse_payment_id(
const std::
string& payment_id_str,
crypto::
hash& payment_id);
1185 bool always_confirm_transfers()
const {
return m_always_confirm_transfers; }
1251 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);
1261 std::string get_spend_proof(
const crypto::hash &txid,
const std::string &message);
1262 bool check_spend_proof(
const crypto::hash &txid,
const std::string &message,
const std::string &sig_str);
1271 std::string get_reserve_proof(
const boost::optional<std::pair<uint32_t, uint64_t>> &account_minreserve,
const std::string &message);
1281 bool check_reserve_proof(
const cryptonote::account_public_address &address,
const std::string &message,
const std::string &sig_str, uint64_t &total, uint64_t &spent);
1289 bool delete_address_book_row(std::size_t row_id);
1291 uint64_t get_num_rct_outputs();
1293 const transfer_details &get_transfer_details(
size_t idx)
const;
1295 uint8_t get_current_hard_fork();
1296 void get_hard_fork_info(uint8_t
version, uint64_t &earliest_height);
1297 bool use_fork_rules(uint8_t
version, int64_t early_blocks = 0);
1298 int get_fee_algorithm();
1300 std::string get_wallet_file()
const;
1301 std::string get_keys_file()
const;
1302 std::string get_daemon_address()
const;
1303 const boost::optional<epee::net_utils::http::login>&
get_daemon_login()
const {
return m_daemon_login; }
1304 uint64_t get_daemon_blockchain_height(std::string& err);
1305 uint64_t get_daemon_blockchain_target_height(std::string& err);
1306 uint64_t get_daemon_adjusted_time();
1311 uint64_t get_approximate_blockchain_height()
const;
1312 uint64_t estimate_blockchain_height();
1313 std::vector<size_t> select_available_outputs_from_histogram(uint64_t
count,
bool atleast,
bool unlocked,
bool allow_rct);
1314 std::vector<size_t> select_available_outputs(
const std::function<
bool(
const transfer_details &td)> &f);
1315 std::vector<size_t> select_available_unmixable_outputs();
1316 std::vector<size_t> select_available_mixable_outputs();
1318 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;
1319 size_t pop_best_value(std::vector<size_t> &unused_dust_indices,
const std::vector<size_t>& selected_transfers,
bool smallest =
false)
const;
1321 void set_tx_note(
const crypto::hash &txid,
const std::string ¬e);
1322 std::string get_tx_note(
const crypto::hash &txid)
const;
1324 void set_tx_device_aux(
const crypto::hash &txid,
const std::string &aux);
1325 std::string get_tx_device_aux(
const crypto::hash &txid)
const;
1327 void set_description(
const std::string &description);
1328 std::string get_description()
const;
1334 const std::pair<serializable_map<std::string, std::string>, std::vector<std::string>>& get_account_tags();
1340 void set_account_tag(
const std::set<uint32_t> &account_indices,
const std::string& tag);
1346 void set_account_tag_description(
const std::string& tag,
const std::string& description);
1359 std::string sign_multisig_participant(
const std::string& data)
const;
1370 std::pair<size_t, std::vector<tools::wallet2::transfer_details>> export_outputs(
bool all =
false)
const;
1371 std::string export_outputs_to_str(
bool all =
false)
const;
1372 size_t import_outputs(
const std::pair<
size_t, std::vector<tools::wallet2::transfer_details>> &outputs);
1373 size_t import_outputs_from_str(
const std::string &outputs_st);
1376 void import_payments_out(
const std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>> &confirmed_payments);
1377 std::tuple<size_t, crypto::hash, std::vector<crypto::hash>> export_blockchain()
const;
1378 void import_blockchain(
const std::tuple<
size_t,
crypto::hash, std::vector<crypto::hash>> &bc);
1379 bool export_key_images(
const std::string &filename,
bool all =
false)
const;
1380 std::pair<size_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> export_key_images(
bool all =
false)
const;
1381 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);
1382 uint64_t import_key_images(
const std::string &filename, uint64_t &spent, uint64_t &unspent);
1383 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);
1384 bool import_key_images(
signed_tx_set & signed_tx,
size_t offset=0,
bool only_selected_transfers=
false);
1387 void update_pool_state(std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &process_txs,
bool refreshed =
false);
1388 void process_pool_state(
const std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &txs);
1389 void remove_obsolete_pool_txs(
const std::vector<crypto::hash> &tx_hashes);
1391 std::string
encrypt(
const char *plaintext,
size_t len,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1394 std::string
encrypt(
const epee::wipeable_string &plaintext,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1395 std::string encrypt_with_view_secret_key(
const std::string &plaintext,
bool authenticated =
true)
const;
1396 template<
typename T=std::
string>
T decrypt(
const std::string &ciphertext,
const crypto::secret_key &skey,
bool authenticated =
true)
const;
1397 std::string decrypt_with_view_secret_key(
const std::string &ciphertext,
bool authenticated =
true)
const;
1399 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;
1400 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);
1402 uint64_t get_blockchain_height_by_date(uint16_t year, uint8_t month, uint8_t day);
1406 std::vector<std::pair<uint64_t, uint64_t>> estimate_backlog(
const std::vector<std::pair<double, double>> &fee_levels);
1407 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);
1409 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, uint64_t base_fee, uint64_t fee_multiplier, uint64_t fee_quantization_mask)
const;
1410 uint64_t get_fee_multiplier(uint32_t priority,
int fee_algorithm = -1);
1411 uint64_t get_base_fee();
1412 uint64_t get_fee_quantization_mask();
1413 uint64_t get_min_ring_size();
1414 uint64_t get_max_ring_size();
1415 uint64_t adjust_mixin(uint64_t mixin);
1417 uint32_t adjust_priority(uint32_t priority);
1421 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);
1423 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);
1424 bool daemon_requires_payment();
1425 bool make_rpc_payment(uint32_t nonce, uint32_t cookie, uint64_t &credits, uint64_t &balance);
1426 bool search_for_rpc_payment(uint64_t credits_target,
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);
1429 m_rpc_payment_state.credits = res.credits;
1430 if (res.top_hash != m_rpc_payment_state.top_hash)
1432 m_rpc_payment_state.top_hash = res.top_hash;
1433 m_rpc_payment_state.stale =
true;
1440 void light_wallet_get_unspent_outs();
1442 void light_wallet_get_address_txs();
1446 bool light_wallet_login(
bool &new_address);
1450 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);
1452 bool light_wallet_parse_rct_str(
const std::string& rct_string,
const crypto::public_key& tx_pub_key, uint64_t internal_output_index,
rct::key& decrypted_mask,
rct::key& rct_commit,
bool decrypt)
const;
1471 const char*
const ATTRIBUTE_DESCRIPTION =
"wallet2.description";
1472 void set_attribute(
const std::string &key,
const std::string &value);
1473 bool get_attribute(
const std::string &key, std::string &value)
const;
1480 template<
class t_request,
class t_response>
1481 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")
1483 if (m_offline)
return false;
1484 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1485 return epee::net_utils::invoke_http_json(uri, req, res, *m_http_client, timeout, http_method);
1487 template<
class t_request,
class t_response>
1488 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")
1490 if (m_offline)
return false;
1491 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1492 return epee::net_utils::invoke_http_bin(uri, req, res, *m_http_client, timeout, http_method);
1494 template<
class t_request,
class t_response>
1495 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")
1497 if (m_offline)
return false;
1498 boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1499 return epee::net_utils::invoke_http_json_rpc(uri, method_name, req, res, *m_http_client, timeout, http_method, req_id);
1502 bool set_ring_database(
const std::string &filename);
1507 bool unset_ring(
const std::vector<crypto::key_image> &key_images);
1509 bool find_and_save_rings(
bool force =
true);
1511 bool blackball_output(
const std::pair<uint64_t, uint64_t> &output);
1512 bool set_blackballed_outputs(
const std::vector<std::pair<uint64_t, uint64_t>> &outputs,
bool add =
false);
1513 bool unblackball_output(
const std::pair<uint64_t, uint64_t> &output);
1514 bool is_output_blackballed(
const std::pair<uint64_t, uint64_t> &output)
const;
1516 void freeze(
size_t idx);
1517 void thaw(
size_t idx);
1518 bool frozen(
size_t idx)
const;
1522 bool frozen(
const transfer_details &td)
const;
1524 bool save_to_file(
const std::string& path_to_file,
const std::string& binary,
bool is_printable =
false)
const;
1525 static bool load_from_file(
const std::string& path_to_file, std::string& target_str,
size_t max_size = 1000000000);
1527 uint64_t get_bytes_sent()
const;
1528 uint64_t get_bytes_received()
const;
1535 bool lock_keys_file();
1536 bool unlock_keys_file();
1537 bool is_keys_file_locked()
const;
1539 void change_password(
const std::string &filename,
const epee::wipeable_string &original_password,
const epee::wipeable_string &new_password);
1541 void set_tx_notify(
const std::shared_ptr<tools::Notify> ¬ify) { m_tx_notify = notify; }
1543 bool is_tx_spendtime_unlocked(uint64_t unlock_time, uint64_t block_height);
1544 void hash_m_transfer(
const transfer_details & transfer,
crypto::hash &
hash)
const;
1545 uint64_t hash_m_transfers(int64_t transfer_height,
crypto::hash &
hash)
const;
1546 void finish_rescan_bc_keep_key_images(uint64_t transfer_height,
const crypto::hash &
hash);
1548 void set_offline(
bool offline =
true);
1550 uint64_t
credits()
const {
return m_rpc_payment_state.credits; }
1551 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; }
1563 bool store_keys(
const std::string& keys_file_name,
const epee::wipeable_string& password,
bool watch_only =
false);
1569 bool load_keys(
const std::string& keys_file_name,
const epee::wipeable_string& password);
1575 bool load_keys_buf(
const std::string& keys_buf,
const epee::wipeable_string& password);
1576 bool load_keys_buf(
const std::string& keys_buf,
const epee::wipeable_string& password, boost::optional<crypto::chacha_key>& keys_to_encrypt);
1577 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);
1579 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::map<std::pair<uint64_t, uint64_t>,
size_t> *output_tracker_cache = NULL);
1580 void detach_blockchain(uint64_t height, std::map<std::pair<uint64_t, uint64_t>,
size_t> *output_tracker_cache = NULL);
1581 void get_short_chain_history(std::list<crypto::hash>& ids, uint64_t granularity = 1)
const;
1583 void clear_soft(
bool keep_key_images=
false);
1584 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);
1585 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);
1586 void fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history,
bool force =
false);
1587 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);
1588 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);
1589 uint64_t select_transfers(uint64_t needed_money, std::vector<size_t> unused_transfers_indices, std::vector<size_t>& selected_transfers)
const;
1590 bool prepare_file_names(
const std::string& file_path);
1592 void process_outgoing(
const crypto::hash &txid,
const cryptonote::transaction& tx, uint64_t height, uint64_t
ts, uint64_t spent, uint64_t received, uint32_t subaddr_account,
const std::set<uint32_t>& subaddr_indices);
1593 void add_unconfirmed_tx(
const cryptonote::transaction& tx, uint64_t amount_in,
const std::vector<cryptonote::tx_destination_entry> &dests,
const crypto::hash &payment_id, uint64_t change_amount, uint32_t subaddr_account,
const std::set<uint32_t>& subaddr_indices);
1595 void check_genesis(
const crypto::hash& genesis_hash)
const;
1596 bool generate_chacha_key_from_secret_keys(crypto::chacha_key &key)
const;
1597 void generate_chacha_key_from_password(
const epee::wipeable_string &pass, crypto::chacha_key &key)
const;
1598 crypto::hash get_payment_id(
const pending_tx &ptx)
const;
1599 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;
1600 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;
1601 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;
1603 uint64_t get_upper_transaction_weight_limit();
1604 std::vector<uint64_t> get_unspent_amounts_vector(
bool strict);
1605 uint64_t get_dynamic_base_fee_estimate();
1606 float get_output_relatedness(
const transfer_details &td0,
const transfer_details &td1)
const;
1607 std::vector<size_t> pick_preferred_rct_inputs(uint64_t needed_money, uint32_t subaddr_account,
const std::set<uint32_t> &subaddr_indices);
1608 void set_spent(
size_t idx, uint64_t height);
1609 void set_unspent(
size_t idx);
1610 bool is_spent(
const transfer_details &td,
bool strict =
true)
const;
1611 bool is_spent(
size_t idx,
bool strict =
true)
const;
1612 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);
1613 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);
1614 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;
1615 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;
1616 std::vector<size_t> get_only_rct(
const std::vector<size_t> &unused_dust_indices,
const std::vector<size_t> &unused_transfers_indices)
const;
1617 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);
1618 void trim_hashchain();
1620 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;
1622 rct::key get_multisig_k(
size_t idx,
const std::unordered_set<rct::key> &used_L)
const;
1623 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);
1628 crypto::chacha_key get_ringdb_key();
1629 void setup_keys(
const epee::wipeable_string &password);
1632 void register_devices();
1633 hw::device& lookup_device(
const std::string & device_descriptor);
1635 bool get_rct_distribution(uint64_t &start_height, std::vector<uint64_t> &distribution);
1637 uint64_t get_segregation_fork_height()
const;
1638 void unpack_multisig_info(
const std::vector<std::string>&
info,
1639 std::vector<crypto::public_key> &public_keys,
1640 std::vector<crypto::secret_key> &secret_keys)
const;
1641 bool unpack_extra_multisig_info(
const std::vector<std::string>&
info,
1642 std::vector<crypto::public_key> &signers,
1643 std::unordered_set<crypto::public_key> &pkeys)
const;
1646 std::shared_ptr<std::map<std::pair<uint64_t, uint64_t>,
size_t>> create_output_tracker_cache()
const;
1649 void setup_new_blockchain();
1650 void create_keys_file(
const std::string &wallet_,
bool watch_only,
const epee::wipeable_string &password,
bool create_address_file);
1653 void on_device_button_request(uint64_t code);
1654 void on_device_button_pressed();
1655 boost::optional<epee::wipeable_string> on_device_pin_request();
1656 boost::optional<epee::wipeable_string> on_device_passphrase_request(
bool & on_device);
1659 std::string get_rpc_status(
const std::string &
s)
const;
1660 void throw_on_rpc_response_error(
bool r,
const epee::json_rpc::error &
error,
const std::string &status,
const char *method)
const;
1662 std::string get_client_signature()
const;
1663 void check_rpc_cost(
const char *call, uint64_t post_call_credits, uint64_t pre_credits,
double expected_cost);
1674 const std::unique_ptr<epee::net_utils::http::abstract_http_client>
m_http_client;
1693 std::pair<serializable_map<std::string, std::string>, std::vector<std::string>>
m_account_tags;
1751 std::unordered_set<crypto::hash> m_scanned_pool_txs[2];
1832 template <
class Archive>
1836 template <
class Archive>
1880 template <
class Archive>
1979 template <
class Archive>
1986 template <
class Archive>
1994 template <
class Archive>
2001 template <
class Archive>
2035 if (!
typename Archive::is_saving() && x.
m_change != (uint64_t)-1)
2050 template <
class Archive>
2072 if (!
typename Archive::is_saving() && x.
m_change != (uint64_t)-1)
2080 if (!
typename Archive::is_saving())
2097 template <
class Archive>
2132 template <
class Archive>
2139 template <
class Archive>
2150 bool is_long =
false;
2151 for (
int i = 8; i < 32; ++i)
2152 is_long |= payment_id.data[i];
2155 MWARNING(
"Long payment ID ignored on address book load");
2177 template <
class Archive>
2188 template <
class Archive>
2195 template <
class Archive>
2205 template <
class Archive>
2214 std::list<size_t> selected_transfers;
2215 a & selected_transfers;
2218 for (
size_t t: selected_transfers)
2234 if (!
typename Archive::is_saving())
2241 if (!
typename Archive::is_saving())
2248 a & use_bulletproofs;
2249 if (!
typename Archive::is_saving())
2256 template <
class Archive>
2266 template <
class Archive>
2277 std::list<size_t> selected_transfers;
2278 a & selected_transfers;
2281 for (
size_t t: selected_transfers)
2309 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2311 splitted_dsts.clear();
2317 [&](uint64_t chunk) { splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, de.addr, de.is_subaddress)); },
2318 [&](uint64_t a_dust) { splitted_dsts.push_back(cryptonote::tx_destination_entry(a_dust, de.addr, de.is_subaddress)); } );
2322 [&](uint64_t chunk) {
2323 if (chunk <= dust_threshold)
2324 dust_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, false));
2326 splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, false));
2328 [&](uint64_t a_dust) { dust_dsts.push_back(cryptonote::tx_destination_entry(a_dust, change_dst.addr, false)); } );
2333 std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2335 splitted_dsts = dsts;
2338 uint64_t change = change_dst.
amount;
2348 std::string indexes;
#define s(x, c)
Definition: aesb.c:47
static void init(std::string cache_filename)
Definition: blockchain_blackball.cpp:221
A container for blockchain checkpoints.
Definition: checkpoints.h:53
Definition: cryptonote_basic.h:160
std::vector< tx_out > vout
Definition: cryptonote_basic.h:168
Definition: cryptonote_basic.h:194
Definition: device.hpp:71
Definition: device.hpp:87
device_type
Definition: device.hpp:105
Definition: device.hpp:77
Definition: message_store.h:267
std::unordered_map< K, V > & parent()
Definition: containers.h:52
Definition: containers.h:71
#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
void * memcpy(void *a, const void *b, size_t c)
Definition: glibc_compat.cpp:16
const uint32_t T[512]
Definition: groestl_tables.h:36
string a
Definition: MakeCryptoOps.py:15
boost::optional< tools::password_container > password_prompter(const char *prompt, bool verify)
Definition: simplewallet.cpp:319
tools::wallet2::RefreshType refresh_type
Definition: simplewallet.cpp:418
int b
Definition: base.py:1
Definition: blocks.cpp:13
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
Definition: unordered_containers_boost_serialization.h:54
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:1837
Definition: unordered_containers_boost_serialization.h:38
const
Definition: build_protob.py:9
crypto namespace.
Definition: crypto.cpp:60
POD_CLASS signature
Definition: crypto.h:93
constexpr static crypto::hash null_hash
Definition: hash.h:92
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:67
POD_CLASS hash8
Definition: hash.h:51
POD_CLASS key_derivation
Definition: crypto.h:83
POD_CLASS public_key
Definition: crypto.h:61
bool check_tx_proof(const hash &prefix_hash, const public_key &R, const public_key &A, const boost::optional< public_key > &B, const public_key &D, const signature &sig, const int version)
Definition: crypto.h:256
POD_CLASS key_image
Definition: crypto.h:87
constexpr static crypto::hash8 null_hash8
Definition: hash.h:93
POD_CLASS hash
Definition: hash.h:48
network_type
Definition: cryptonote_config.h:273
@ MAINNET
Definition: cryptonote_config.h:274
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:210
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:1028
crypto::hash get_transaction_hash(const transaction &t)
Definition: cryptonote_format_utils.cpp:1058
std::string blobdata
Definition: blobdatatype.h:39
void init_options(boost::program_options::options_description &hidden_options, boost::program_options::options_description &normal_options)
Definition: posix_daemonizer.inl:56
declaration and default definition for the functions used the API
Definition: expect.cpp:34
tools::wallet2::tx_construction_data tx_construction_data
Definition: protocol.hpp:158
tools::wallet2::unsigned_tx_set unsigned_tx_set
Definition: protocol.hpp:159
std::shared_ptr< messages::monero::MoneroGetTxKeyRequest > get_tx_key(const hw::device_cold::tx_key_data_t &tx_data)
Definition: protocol.cpp:1098
mdb_size_t count(MDB_cursor *cur)
Definition: value_stream.cpp:39
error
Tracks LMDB error codes.
Definition: error.h:45
version
Supported socks variants.
Definition: socks.h:58
Definition: bulletproofs.cc:64
static void add(ge_p3 &p3, const ge_cached &other)
Definition: multiexp.cc:143
@ RangeProofBorromean
Definition: rctTypes.h:261
@ RangeProofBulletproof
Definition: rctTypes.h:261
key identity()
Definition: rctOps.h:73
Definition: binary_utils.h:36
char true_type
Definition: sfinae_helpers.h:39
Definition: blockchain_ancestry.cpp:72
BOOST_CLASS_VERSION(nodetool::peerlist_types, nodetool::CURRENT_PEERLIST_STORAGE_ARCHIVE_VER)
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:138
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:123
#define BEGIN_SERIALIZE_OBJECT()
begins the environment of the DSL \detailed for described the serialization of an object
Definition: serialization.h:191
#define FIELD(f)
tags the field with the variable name and then serializes it
Definition: serialization.h:244
#define VERSION_FIELD(v)
Definition: serialization.h:295
#define MAGIC_FIELD(m)
Definition: serialization.h:284
#define END_SERIALIZE()
self-explanatory
Definition: serialization.h:215
#define VARINT_FIELD(f)
tags and serializes the varint f
Definition: serialization.h:264
static const unsigned char iv[64]
Definition: sha512-hash.c:13
#define ts
Definition: skein.c:522
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:90
#define true
Definition: stdbool.h:36
Definition: core_rpc_server_commands_defs.h:191
Definition: cryptonote_basic.h:501
Definition: cryptonote_protocol_defs.h:133
Definition: cryptonote_basic.h:464
Definition: cryptonote_basic.h:528
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:143
Definition: cryptonote_tx_utils.h:43
uint64_t amount
Definition: cryptonote_tx_utils.h:51
size_t real_output
Definition: cryptonote_tx_utils.h:47
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
size_t real_output_in_tx_index
Definition: cryptonote_tx_utils.h:50
Definition: cryptonote_basic.h:77
crypto::public_key key
Definition: cryptonote_basic.h:80
Definition: message_store.h:241
Definition: rctTypes.h:262
RangeProofType range_proof_type
Definition: rctTypes.h:263
Definition: rctTypes.h:79
Definition: rctTypes.h:105
Definition: rctTypes.h:114
Definition: rctTypes.h:536
Definition: wallet2.h:653
crypto::public_key shared_secret
Definition: wallet2.h:656
crypto::signature key_image_sig
Definition: wallet2.h:659
crypto::signature shared_secret_sig
Definition: wallet2.h:658
uint64_t index_in_tx
Definition: wallet2.h:655
crypto::key_image key_image
Definition: wallet2.h:657
crypto::hash txid
Definition: wallet2.h:654