Electroneum
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
tools::wallet2 Class Reference

#include <wallet2.h>

Collaboration diagram for tools::wallet2:
Collaboration graph
[legend]

Classes

struct  address_book_row
 
struct  cache_file_data
 
struct  confirmed_transfer_details
 
struct  keys_file_data
 
struct  payment_details
 
struct  pending_tx
 
struct  signed_tx_set
 
struct  transfer_details
 
struct  tx_construction_data
 
struct  unconfirmed_transfer_details
 
struct  unsigned_tx_set
 

Public Types

enum  RefreshType { RefreshFull, RefreshOptimizeCoinbase, RefreshNoCoinbase, RefreshDefault = RefreshOptimizeCoinbase }
 
typedef std::vector< transfer_detailstransfer_container
 
typedef std::unordered_multimap< crypto::hash, payment_detailspayment_container
 
typedef std::tuple< uint64_t, crypto::public_key, rct::keyget_outs_entry
 

Public Member Functions

 wallet2 (bool testnet=false, bool restricted=false)
 
crypto::secret_key generate (const std::string &wallet, const std::string &password, const crypto::secret_key &recovery_param=crypto::secret_key(), bool recover=false, bool two_random=false)
 Generates a wallet or restores one. More...
 
void generate (const std::string &wallet, const std::string &password, const cryptonote::account_public_address &account_public_address, const crypto::secret_key &spendkey, const crypto::secret_key &viewkey)
 Creates a wallet from a public address and a spend/view secret key pair. More...
 
void generate (const std::string &wallet, const std::string &password, const cryptonote::account_public_address &account_public_address, const crypto::secret_key &viewkey=crypto::secret_key())
 Creates a watch only wallet from a public address and a view secret key. More...
 
void rewrite (const std::string &wallet_name, const std::string &password)
 Rewrites to the wallet file for wallet upgrade (doesn't generate key, assumes it's already there) More...
 
void write_watch_only_wallet (const std::string &wallet_name, const std::string &password)
 Writes to a file named based on the normal wallet (doesn't generate key, assumes it's already there) More...
 
void load (const std::string &wallet, const std::string &password)
 
void store ()
 
void store_to (const std::string &path, const std::string &password)
 store_to - stores wallet to another file(s), deleting old ones More...
 
std::string path () const
 
bool verify_password (const std::string &password) const
 verifies given password is correct for default wallet keys file More...
 
cryptonote::account_baseget_account ()
 
const cryptonote::account_baseget_account () const
 
void set_refresh_from_block_height (uint64_t height)
 
uint64_t get_refresh_from_block_height () const
 
bool deinit ()
 
bool init (std::string daemon_address="http://localhost:8080", boost::optional< epee::net_utils::http::login > daemon_login=boost::none, std::string blockchain_db_path="", uint64_t upper_transaction_size_limit=0)
 
void stop ()
 
i_wallet2_callbackcallback () const
 
void callback (i_wallet2_callback *callback)
 
bool is_deterministic () const
 Checks if deterministic wallet. More...
 
bool get_seed (std::string &electrum_words) const
 
const std::string & get_seed_language () const
 Gets the seed language. More...
 
void set_seed_language (const std::string &language)
 Sets the seed language. More...
 
bool is_deprecated () const
 Tells if the wallet file is deprecated. More...
 
void refresh ()
 
void refresh (uint64_t start_height, uint64_t &blocks_fetched)
 
void refresh (uint64_t start_height, uint64_t &blocks_fetched, bool &received_money)
 
bool refresh (uint64_t &blocks_fetched, bool &received_money, bool &ok)
 
void set_refresh_type (RefreshType refresh_type)
 
RefreshType get_refresh_type () const
 
bool testnet () const
 
bool restricted () const
 
bool watch_only () const
 
uint64_t balance () const
 
uint64_t unlocked_balance () const
 
uint64_t unlocked_dust_balance (const tx_dust_policy &dust_policy) const
 
template<typename T >
void transfer (const std::vector< cryptonote::tx_destination_entry > &dsts, const size_t fake_outputs_count, const std::vector< size_t > &unused_transfers_indices, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, T destination_split_strategy, const tx_dust_policy &dust_policy, bool trusted_daemon)
 
template<typename T >
void transfer (const std::vector< cryptonote::tx_destination_entry > &dsts, const size_t fake_outputs_count, const std::vector< size_t > &unused_transfers_indices, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, T destination_split_strategy, const tx_dust_policy &dust_policy, cryptonote::transaction &tx, pending_tx &ptx, bool trusted_daemon)
 
void transfer (const std::vector< cryptonote::tx_destination_entry > &dsts, const size_t fake_outputs_count, const std::vector< size_t > &unused_transfers_indices, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, bool trusted_daemon)
 
void transfer (const std::vector< cryptonote::tx_destination_entry > &dsts, const size_t fake_outputs_count, const std::vector< size_t > &unused_transfers_indices, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, cryptonote::transaction &tx, pending_tx &ptx, bool trusted_daemon)
 
template<typename T >
void transfer_selected (const std::vector< cryptonote::tx_destination_entry > &dsts, const std::list< size_t > selected_transfers, size_t fake_outputs_count, std::vector< std::vector< tools::wallet2::get_outs_entry >> &outs, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, T destination_split_strategy, const tx_dust_policy &dust_policy, cryptonote::transaction &tx, pending_tx &ptx)
 
void transfer_selected_rct (std::vector< cryptonote::tx_destination_entry > dsts, const std::list< size_t > selected_transfers, size_t fake_outputs_count, std::vector< std::vector< tools::wallet2::get_outs_entry >> &outs, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, cryptonote::transaction &tx, pending_tx &ptx)
 
void commit_tx (pending_tx &ptx_vector)
 
void commit_tx (std::vector< pending_tx > &ptx_vector)
 
bool save_tx (const std::vector< pending_tx > &ptx_vector, const std::string &filename)
 
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 sign_tx (unsigned_tx_set &exported_txs, const std::string &signed_filename, std::vector< wallet2::pending_tx > &ptx)
 
bool load_unsigned_tx (const std::string &unsigned_filename, unsigned_tx_set &exported_txs)
 
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)
 
std::vector< pending_txcreate_transactions (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, bool trusted_daemon)
 
std::vector< wallet2::pending_txcreate_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, bool trusted_daemon)
 
std::vector< wallet2::pending_txcreate_transactions_all (uint64_t below, const cryptonote::account_public_address &address, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector< uint8_t > extra, bool trusted_daemon)
 
std::vector< wallet2::pending_txcreate_transactions_from (const cryptonote::account_public_address &address, 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, bool trusted_daemon)
 
std::vector< pending_txcreate_unmixable_sweep_transactions (bool trusted_daemon)
 
bool check_connection (uint32_t *version=NULL, uint32_t timeout=200000)
 
void get_transfers (wallet2::transfer_container &incoming_transfers) const
 
void save_transfers_to_csv (bool in, bool out, uint64_t min_height, uint64_t max_height)
 
void get_payments (const crypto::hash &payment_id, std::list< wallet2::payment_details > &payments, uint64_t min_height=0) const
 
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
 
void get_payments_out (std::list< std::pair< crypto::hash, wallet2::confirmed_transfer_details >> &confirmed_payments, uint64_t min_height, uint64_t max_height=(uint64_t) -1) const
 
void get_unconfirmed_payments_out (std::list< std::pair< crypto::hash, wallet2::unconfirmed_transfer_details >> &unconfirmed_payments) const
 
void get_unconfirmed_payments (std::list< std::pair< crypto::hash, wallet2::payment_details >> &unconfirmed_payments) const
 
uint64_t get_blockchain_current_height () const
 
void rescan_spent ()
 
void rescan_blockchain (bool refresh=true)
 
bool is_transfer_unlocked (const transfer_details &td) const
 
template<class t_archive >
void serialize (t_archive &a, const unsigned int ver)
 
bool always_confirm_transfers () const
 
void always_confirm_transfers (bool always)
 
bool print_ring_members () const
 
void print_ring_members (bool value)
 
bool store_tx_info () const
 
void store_tx_info (bool store)
 
uint32_t get_default_priority () const
 
void set_default_priority (uint32_t p)
 
bool auto_refresh () const
 
void auto_refresh (bool r)
 
bool confirm_missing_payment_id () const
 
void confirm_missing_payment_id (bool always)
 
bool ask_password () const
 
void ask_password (bool always)
 
void set_default_decimal_point (unsigned int decimal_point)
 
unsigned int get_default_decimal_point () const
 
void set_min_output_count (uint32_t count)
 
uint32_t get_min_output_count () const
 
void set_min_output_value (uint64_t value)
 
uint64_t get_min_output_value () const
 
void merge_destinations (bool merge)
 
bool merge_destinations () const
 
bool confirm_backlog () const
 
void confirm_backlog (bool always)
 
bool display_progress_indicator () const
 
void display_progress_indicator (bool always)
 
bool get_tx_key (const crypto::hash &txid, crypto::secret_key &tx_key) const
 
std::vector< address_book_rowget_address_book () const
 GUI Address book get/store. More...
 
bool add_address_book_row (const cryptonote::account_public_address &address, const crypto::hash &payment_id, const std::string &description)
 
bool delete_address_book_row (std::size_t row_id)
 
uint64_t get_num_rct_outputs ()
 
const transfer_detailsget_transfer_details (size_t idx) const
 
void get_hard_fork_info (uint8_t version, uint64_t &earliest_height)
 
bool use_fork_rules (uint8_t version, int64_t early_blocks=0)
 
int get_fee_algorithm ()
 
std::string get_wallet_file () const
 
std::string get_keys_file () const
 
std::string get_daemon_address () const
 
const boost::optional< epee::net_utils::http::login > & get_daemon_login () const
 
uint64_t get_daemon_blockchain_height (std::string &err)
 
uint64_t get_daemon_blockchain_target_height (std::string &err)
 
uint64_t get_approximate_blockchain_height () const
 Calculates the approximate blockchain height from current date/time. More...
 
std::vector< size_t > select_available_outputs_from_histogram (uint64_t count, bool atleast, bool unlocked, bool allow_rct, bool trusted_daemon)
 
std::vector< size_t > select_available_outputs (const std::function< bool(const transfer_details &td)> &f)
 
std::vector< size_t > select_available_unmixable_outputs (bool trusted_daemon)
 
std::vector< size_t > select_available_mixable_outputs (bool trusted_daemon)
 
size_t pop_best_value_from (const transfer_container &transfers, std::vector< size_t > &unused_dust_indices, const std::list< size_t > &selected_transfers, bool smallest=false) const
 
size_t pop_best_value (std::vector< size_t > &unused_dust_indices, const std::list< size_t > &selected_transfers, bool smallest=false) const
 
void set_tx_note (const crypto::hash &txid, const std::string &note)
 
std::string get_tx_note (const crypto::hash &txid) const
 
std::string sign (const std::string &data) const
 
bool verify (const std::string &data, const cryptonote::account_public_address &address, const std::string &signature) const
 
std::vector< tools::wallet2::transfer_detailsexport_outputs () const
 
size_t import_outputs (const std::vector< tools::wallet2::transfer_details > &outputs)
 
bool export_key_images (const std::string filename)
 
std::vector< std::pair< crypto::key_image, crypto::signature > > export_key_images () const
 
uint64_t import_key_images (const std::vector< std::pair< crypto::key_image, crypto::signature >> &signed_key_images, uint64_t &spent, uint64_t &unspent)
 
uint64_t import_key_images (const std::string &filename, uint64_t &spent, uint64_t &unspent)
 
void update_pool_state (bool refreshed=false)
 
std::string encrypt (const std::string &plaintext, const crypto::secret_key &skey, bool authenticated=true) const
 
std::string encrypt_with_view_secret_key (const std::string &plaintext, bool authenticated=true) const
 
std::string decrypt (const std::string &ciphertext, const crypto::secret_key &skey, bool authenticated=true) const
 
std::string decrypt_with_view_secret_key (const std::string &ciphertext, bool authenticated=true) const
 
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)
 
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)
 
uint64_t get_blockchain_height_by_date (uint16_t year, uint8_t month, uint8_t day)
 
bool is_synced () const
 
std::vector< std::pair< uint64_t, uint64_t > > estimate_backlog (uint64_t min_blob_size, uint64_t max_blob_size, const std::vector< uint64_t > &fees)
 
uint64_t get_fee_multiplier (uint32_t priority, int fee_algorithm=-1)
 
uint64_t get_per_kb_fee ()
 
void set_blockchain_storage (etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 
etneg::MicroCoreget_core () const
 
cryptonote::Blockchainget_storage () const
 
template<typename T >
void transfer_selected (const std::vector< cryptonote::tx_destination_entry > &dsts, const std::list< size_t > selected_transfers, size_t fake_outputs_count, std::vector< std::vector< tools::wallet2::get_outs_entry >> &outs, uint64_t unlock_time, uint64_t fee, const std::vector< uint8_t > &extra, T destination_split_strategy, const tx_dust_policy &dust_policy, cryptonote::transaction &tx, pending_tx &ptx)
 

Static Public Member Functions

static const char * tr (const char *str)
 
static bool has_testnet_option (const boost::program_options::variables_map &vm)
 
static void init_options (boost::program_options::options_description &desc_params)
 
static boost::optional< password_containerpassword_prompt (const bool new_password)
 
static std::unique_ptr< wallet2make_from_json (const boost::program_options::variables_map &vm, const std::string &json_file, etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 Uses stdin and stdout. Returns a wallet2 if no errors. More...
 
static std::pair< std::unique_ptr< wallet2 >, password_containermake_from_file (const boost::program_options::variables_map &vm, const std::string &wallet_file, etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 Uses stdin and stdout. Returns a wallet2 and password for wallet_file if no errors. More...
 
static std::pair< std::unique_ptr< wallet2 >, password_containermake_new (const boost::program_options::variables_map &vm, etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 Uses stdin and stdout. Returns a wallet2 and password for wallet with no file if no errors. More...
 
static std::unique_ptr< wallet2make_dummy (const boost::program_options::variables_map &vm, etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 Just parses variables. More...
 
static bool verify_password (const std::string &keys_file_name, const std::string &password, bool watch_only)
 verify password for specified wallet keys file. More...
 
static void wallet_exists (const std::string &file_path, bool &keys_file_exists, bool &wallet_file_exists)
 Check if wallet keys and bin files exist. More...
 
static std::string get_human_readable_timestamp (uint64_t ts)
 Check if wallet file path is valid format. More...
 
static bool wallet_valid_path_format (const std::string &file_path)
 
static bool parse_long_payment_id (const std::string &payment_id_str, crypto::hash &payment_id)
 
static bool parse_short_payment_id (const std::string &payment_id_str, crypto::hash8 &payment_id)
 
static bool parse_payment_id (const std::string &payment_id_str, crypto::hash &payment_id)
 

Static Public Attributes

static constexpr const std::chrono::seconds rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30)
 

Private Member Functions

 wallet2 (const wallet2 &)
 
bool store_keys (const std::string &keys_file_name, const std::string &password, bool watch_only=false)
 Stores wallet information to wallet file. More...
 
bool load_keys (const std::string &keys_file_name, const std::string &password)
 Load wallet information from wallet file. More...
 
void process_new_transaction (const crypto::hash &txid, const cryptonote::transaction &tx, const std::vector< uint64_t > &o_indices, uint64_t height, uint64_t ts, bool miner_tx, bool pool)
 
void process_new_blockchain_entry (const cryptonote::block &b, const cryptonote::block_complete_entry &bche, const crypto::hash &bl_id, uint64_t height, const cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices &o_indices)
 
void detach_blockchain (uint64_t height)
 
void get_short_chain_history (std::list< crypto::hash > &ids) const
 
bool is_tx_spendtime_unlocked (uint64_t unlock_time, uint64_t block_height) const
 
bool clear ()
 
void pull_blocks (uint64_t start_height, uint64_t &blocks_start_height, const std::list< crypto::hash > &short_chain_history, std::list< cryptonote::block_complete_entry > &blocks, std::vector< cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices > &o_indices)
 
void pull_hashes (uint64_t start_height, uint64_t &blocks_start_height, const std::list< crypto::hash > &short_chain_history, std::list< crypto::hash > &hashes)
 
void fast_refresh (uint64_t stop_height, uint64_t &blocks_start_height, std::list< crypto::hash > &short_chain_history)
 
void pull_next_blocks (uint64_t start_height, uint64_t &blocks_start_height, std::list< crypto::hash > &short_chain_history, const std::list< cryptonote::block_complete_entry > &prev_blocks, std::list< cryptonote::block_complete_entry > &blocks, std::vector< cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices > &o_indices, bool &error)
 
void process_blocks (uint64_t start_height, const std::list< cryptonote::block_complete_entry > &blocks, const std::vector< cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices > &o_indices, uint64_t &blocks_added)
 
uint64_t select_transfers (uint64_t needed_money, std::vector< size_t > unused_transfers_indices, std::list< size_t > &selected_transfers, bool trusted_daemon)
 
bool prepare_file_names (const std::string &file_path)
 
void process_unconfirmed (const crypto::hash &txid, const cryptonote::transaction &tx, uint64_t height)
 
void process_outgoing (const crypto::hash &txid, const cryptonote::transaction &tx, uint64_t height, uint64_t ts, uint64_t spent, uint64_t received)
 
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)
 
void generate_genesis (cryptonote::block &b)
 
void check_genesis (const crypto::hash &genesis_hash) const
 
bool generate_chacha8_key_from_secret_keys (crypto::chacha8_key &key) const
 
crypto::hash get_payment_id (const pending_tx &ptx) const
 
crypto::hash8 get_short_payment_id (const pending_tx &ptx) const
 
void check_acc_out_precomp (const crypto::public_key &spend_public_key, const cryptonote::tx_out &o, const crypto::key_derivation &derivation, size_t i, bool &received, uint64_t &money_transfered, bool &error) const
 
void check_acc_out_precomp_once (const crypto::public_key &spend_public_key, const cryptonote::tx_out &o, const crypto::key_derivation &derivation, size_t i, bool &received, uint64_t &money_transfered, bool &error, bool &already_seen) const
 
void parse_block_round (const cryptonote::blobdata &blob, cryptonote::block &bl, crypto::hash &bl_id, bool &error) const
 
uint64_t get_upper_transaction_size_limit ()
 
std::vector< uint64_t > get_unspent_amounts_vector ()
 
uint64_t get_dynamic_per_kb_fee_estimate ()
 
float get_output_relatedness (const transfer_details &td0, const transfer_details &td1) const
 
std::vector< size_t > pick_preferred_rct_inputs (uint64_t needed_money) const
 
void set_spent (size_t idx, uint64_t height)
 
void set_unspent (size_t idx)
 
void get_outs (std::vector< std::vector< get_outs_entry >> &outs, const std::list< size_t > &selected_transfers, size_t fake_outputs_count)
 
bool wallet_generate_key_image_helper (const cryptonote::account_keys &ack, const crypto::public_key &tx_public_key, size_t real_output_index, cryptonote::keypair &in_ephemeral, crypto::key_image &ki)
 
crypto::public_key get_tx_pub_key_from_received_outs (const tools::wallet2::transfer_details &td) const
 
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
 
std::vector< size_t > get_only_rct (const std::vector< size_t > &unused_dust_indices, const std::vector< size_t > &unused_transfers_indices) const
 
bool get_blocks_from_db (const cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::request &req, cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response &res)
 
bool get_hashes_from_db (const cryptonote::COMMAND_RPC_GET_HASHES_FAST::request &req, cryptonote::COMMAND_RPC_GET_HASHES_FAST::response &res)
 
void load_database (const std::string blockchain_db_path)
 
cryptonote::blobdata get_pruned_tx_blob (const cryptonote::blobdata &blobdata)
 

Private Attributes

cryptonote::account_base m_account
 
boost::optional< epee::net_utils::http::login > m_daemon_login
 
std::string m_daemon_address
 
std::string m_wallet_file
 
std::string m_keys_file
 
epee::net_utils::http::http_simple_client m_http_client
 
std::vector< crypto::hashm_blockchain
 
std::atomic< uint64_t > m_local_bc_height
 
std::unordered_map< crypto::hash, unconfirmed_transfer_detailsm_unconfirmed_txs
 
std::unordered_map< crypto::hash, confirmed_transfer_detailsm_confirmed_txs
 
std::unordered_multimap< crypto::hash, payment_detailsm_unconfirmed_payments
 
std::unordered_map< crypto::hash, crypto::secret_keym_tx_keys
 
transfer_container m_transfers
 
payment_container m_payments
 
std::unordered_map< crypto::key_image, size_t > m_key_images
 
std::unordered_map< crypto::public_key, size_t > m_pub_keys
 
cryptonote::account_public_address m_account_public_address
 
std::unordered_map< crypto::hash, std::string > m_tx_notes
 
std::vector< tools::wallet2::address_book_rowm_address_book
 
uint64_t m_upper_transaction_size_limit
 
std::atomic< boolm_run
 
boost::mutex m_daemon_rpc_mutex
 
i_wallet2_callbackm_callback
 
bool m_testnet
 
bool m_restricted
 
std::string seed_language
 
bool is_old_file_format
 
bool m_watch_only
 
bool m_always_confirm_transfers
 
bool m_print_ring_members
 
bool m_store_tx_info
 
uint32_t m_default_priority
 
RefreshType m_refresh_type
 
bool m_auto_refresh
 
uint64_t m_refresh_from_block_height
 
bool m_confirm_missing_payment_id
 
bool m_ask_password
 
uint32_t m_min_output_count
 
uint64_t m_min_output_value
 
bool m_merge_destinations
 
bool m_confirm_backlog
 
bool m_display_progress_indicator
 
bool m_is_initialized
 
NodeRPCProxy m_node_rpc_proxy
 
std::unordered_set< crypto::hashm_scanned_pool_txs [2]
 
bool m_physical_refresh
 
etneg::MicroCorem_core
 
cryptonote::Blockchainm_blockchain_storage
 
bool is_connected_to_db = false
 

Friends

class ::Serialization_portability_wallet_Test
 

Member Typedef Documentation

◆ get_outs_entry

◆ payment_container

◆ transfer_container

Member Enumeration Documentation

◆ RefreshType

Enumerator
RefreshFull 
RefreshOptimizeCoinbase 
RefreshNoCoinbase 
RefreshDefault 

Constructor & Destructor Documentation

◆ wallet2() [1/2]

tools::wallet2::wallet2 ( const wallet2 )
inlineprivate

◆ wallet2() [2/2]

tools::wallet2::wallet2 ( bool  testnet = false,
bool  restricted = false 
)
inline

Member Function Documentation

◆ add_address_book_row()

bool tools::wallet2::add_address_book_row ( const cryptonote::account_public_address address,
const crypto::hash payment_id,
const std::string &  description 
)

◆ add_unconfirmed_tx()

void tools::wallet2::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 
)
private

◆ always_confirm_transfers() [1/2]

bool tools::wallet2::always_confirm_transfers ( ) const
inline

◆ always_confirm_transfers() [2/2]

void tools::wallet2::always_confirm_transfers ( bool  always)
inline

◆ ask_password() [1/2]

bool tools::wallet2::ask_password ( ) const
inline

◆ ask_password() [2/2]

void tools::wallet2::ask_password ( bool  always)
inline

◆ auto_refresh() [1/2]

bool tools::wallet2::auto_refresh ( ) const
inline

◆ auto_refresh() [2/2]

void tools::wallet2::auto_refresh ( bool  r)
inline

◆ balance()

uint64_t tools::wallet2::balance ( ) const

◆ callback() [1/2]

i_wallet2_callback* tools::wallet2::callback ( ) const
inline

◆ callback() [2/2]

void tools::wallet2::callback ( i_wallet2_callback callback)
inline

◆ check_acc_out_precomp()

void tools::wallet2::check_acc_out_precomp ( const crypto::public_key spend_public_key,
const cryptonote::tx_out o,
const crypto::key_derivation derivation,
size_t  i,
bool received,
uint64_t &  money_transfered,
bool error 
) const
private

◆ check_acc_out_precomp_once()

void tools::wallet2::check_acc_out_precomp_once ( const crypto::public_key spend_public_key,
const cryptonote::tx_out o,
const crypto::key_derivation derivation,
size_t  i,
bool received,
uint64_t &  money_transfered,
bool error,
bool already_seen 
) const
private

◆ check_connection()

bool tools::wallet2::check_connection ( uint32_t *  version = NULL,
uint32_t  timeout = 200000 
)

◆ check_genesis()

void tools::wallet2::check_genesis ( const crypto::hash genesis_hash) const
private

◆ clear()

bool tools::wallet2::clear ( )
private

◆ commit_tx() [1/2]

void tools::wallet2::commit_tx ( pending_tx ptx_vector)

◆ commit_tx() [2/2]

void tools::wallet2::commit_tx ( std::vector< pending_tx > &  ptx_vector)

◆ confirm_backlog() [1/2]

bool tools::wallet2::confirm_backlog ( ) const
inline

◆ confirm_backlog() [2/2]

void tools::wallet2::confirm_backlog ( bool  always)
inline

◆ confirm_missing_payment_id() [1/2]

bool tools::wallet2::confirm_missing_payment_id ( ) const
inline

◆ confirm_missing_payment_id() [2/2]

void tools::wallet2::confirm_missing_payment_id ( bool  always)
inline

◆ create_transactions()

std::vector< wallet2::pending_tx > tools::wallet2::create_transactions ( 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,
bool  trusted_daemon 
)

◆ create_transactions_2()

std::vector< wallet2::pending_tx > tools::wallet2::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,
bool  trusted_daemon 
)

◆ create_transactions_all()

std::vector< wallet2::pending_tx > tools::wallet2::create_transactions_all ( uint64_t  below,
const cryptonote::account_public_address address,
const size_t  fake_outs_count,
const uint64_t  unlock_time,
uint32_t  priority,
const std::vector< uint8_t >  extra,
bool  trusted_daemon 
)

◆ create_transactions_from()

std::vector< wallet2::pending_tx > tools::wallet2::create_transactions_from ( const cryptonote::account_public_address address,
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,
bool  trusted_daemon 
)

◆ create_unmixable_sweep_transactions()

std::vector< wallet2::pending_tx > tools::wallet2::create_unmixable_sweep_transactions ( bool  trusted_daemon)

◆ decrypt()

std::string tools::wallet2::decrypt ( const std::string &  ciphertext,
const crypto::secret_key skey,
bool  authenticated = true 
) const

◆ decrypt_with_view_secret_key()

std::string tools::wallet2::decrypt_with_view_secret_key ( const std::string &  ciphertext,
bool  authenticated = true 
) const

◆ deinit()

bool tools::wallet2::deinit ( )

◆ delete_address_book_row()

bool tools::wallet2::delete_address_book_row ( std::size_t  row_id)

◆ detach_blockchain()

void tools::wallet2::detach_blockchain ( uint64_t  height)
private

◆ display_progress_indicator() [1/2]

bool tools::wallet2::display_progress_indicator ( ) const
inline

◆ display_progress_indicator() [2/2]

void tools::wallet2::display_progress_indicator ( bool  always)
inline

◆ encrypt()

std::string tools::wallet2::encrypt ( const std::string &  plaintext,
const crypto::secret_key skey,
bool  authenticated = true 
) const

◆ encrypt_with_view_secret_key()

std::string tools::wallet2::encrypt_with_view_secret_key ( const std::string &  plaintext,
bool  authenticated = true 
) const

◆ estimate_backlog()

std::vector< std::pair< uint64_t, uint64_t > > tools::wallet2::estimate_backlog ( uint64_t  min_blob_size,
uint64_t  max_blob_size,
const std::vector< uint64_t > &  fees 
)

◆ export_key_images() [1/2]

bool tools::wallet2::export_key_images ( const std::string  filename)

◆ export_key_images() [2/2]

std::vector< std::pair< crypto::key_image, crypto::signature > > tools::wallet2::export_key_images ( ) const

◆ export_outputs()

std::vector< tools::wallet2::transfer_details > tools::wallet2::export_outputs ( ) const

◆ fast_refresh()

void tools::wallet2::fast_refresh ( uint64_t  stop_height,
uint64_t &  blocks_start_height,
std::list< crypto::hash > &  short_chain_history 
)
private

◆ generate() [1/3]

crypto::secret_key tools::wallet2::generate ( const std::string &  wallet_,
const std::string &  password,
const crypto::secret_key recovery_param = crypto::secret_key(),
bool  recover = false,
bool  two_random = false 
)

Generates a wallet or restores one.

Parameters
wallet_Name of wallet file
passwordPassword of wallet file
recovery_paramIf it is a restore, the recovery key
recoverWhether it is a restore
two_randomWhether it is a non-deterministic wallet
Returns
The secret key of the generated wallet

◆ generate() [2/3]

void tools::wallet2::generate ( const std::string &  wallet_,
const std::string &  password,
const cryptonote::account_public_address account_public_address,
const crypto::secret_key spendkey,
const crypto::secret_key viewkey 
)

Creates a wallet from a public address and a spend/view secret key pair.

Parameters
wallet_Name of wallet file
passwordPassword of wallet file
viewkeyview secret key
spendkeyspend secret key
wallet_Name of wallet file
passwordPassword of wallet file
spendkeyspend secret key
viewkeyview secret key

◆ generate() [3/3]

void tools::wallet2::generate ( const std::string &  wallet_,
const std::string &  password,
const cryptonote::account_public_address account_public_address,
const crypto::secret_key viewkey = crypto::secret_key() 
)

Creates a watch only wallet from a public address and a view secret key.

Parameters
wallet_Name of wallet file
passwordPassword of wallet file
viewkeyview secret key

◆ generate_chacha8_key_from_secret_keys()

bool tools::wallet2::generate_chacha8_key_from_secret_keys ( crypto::chacha8_key &  key) const
private

◆ generate_genesis()

void tools::wallet2::generate_genesis ( cryptonote::block b)
private

◆ get_account() [1/2]

cryptonote::account_base& tools::wallet2::get_account ( )
inline

◆ get_account() [2/2]

const cryptonote::account_base& tools::wallet2::get_account ( ) const
inline

◆ get_address_book()

std::vector<address_book_row> tools::wallet2::get_address_book ( ) const
inline

GUI Address book get/store.

◆ get_approximate_blockchain_height()

uint64_t tools::wallet2::get_approximate_blockchain_height ( ) const

Calculates the approximate blockchain height from current date/time.

◆ get_blockchain_current_height()

uint64_t tools::wallet2::get_blockchain_current_height ( ) const
inline

◆ get_blockchain_height_by_date()

uint64_t tools::wallet2::get_blockchain_height_by_date ( uint16_t  year,
uint8_t  month,
uint8_t  day 
)

◆ get_blocks_from_db()

bool tools::wallet2::get_blocks_from_db ( const cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::request req,
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response res 
)
private

◆ get_core()

etneg::MicroCore* tools::wallet2::get_core ( ) const
inline

◆ get_daemon_address()

std::string tools::wallet2::get_daemon_address ( ) const

◆ get_daemon_blockchain_height()

uint64_t tools::wallet2::get_daemon_blockchain_height ( std::string &  err)

◆ get_daemon_blockchain_target_height()

uint64_t tools::wallet2::get_daemon_blockchain_target_height ( std::string &  err)

◆ get_daemon_login()

const boost::optional<epee::net_utils::http::login>& tools::wallet2::get_daemon_login ( ) const
inline

◆ get_default_decimal_point()

unsigned int tools::wallet2::get_default_decimal_point ( ) const

◆ get_default_priority()

uint32_t tools::wallet2::get_default_priority ( ) const
inline

◆ get_dynamic_per_kb_fee_estimate()

uint64_t tools::wallet2::get_dynamic_per_kb_fee_estimate ( )
private

◆ get_fee_algorithm()

int tools::wallet2::get_fee_algorithm ( )

◆ get_fee_multiplier()

uint64_t tools::wallet2::get_fee_multiplier ( uint32_t  priority,
int  fee_algorithm = -1 
)

◆ get_hard_fork_info()

void tools::wallet2::get_hard_fork_info ( uint8_t  version,
uint64_t &  earliest_height 
)

◆ get_hashes_from_db()

bool tools::wallet2::get_hashes_from_db ( const cryptonote::COMMAND_RPC_GET_HASHES_FAST::request req,
cryptonote::COMMAND_RPC_GET_HASHES_FAST::response res 
)
private

◆ get_human_readable_timestamp()

static std::string tools::wallet2::get_human_readable_timestamp ( uint64_t  ts)
inlinestatic

Check if wallet file path is valid format.

Parameters
file_pathWallet file path
Returns
Whether path is valid format

◆ get_keys_file()

std::string tools::wallet2::get_keys_file ( ) const

◆ get_min_output_count()

uint32_t tools::wallet2::get_min_output_count ( ) const
inline

◆ get_min_output_value()

uint64_t tools::wallet2::get_min_output_value ( ) const
inline

◆ get_num_rct_outputs()

uint64_t tools::wallet2::get_num_rct_outputs ( )

◆ get_only_rct()

std::vector< size_t > tools::wallet2::get_only_rct ( const std::vector< size_t > &  unused_dust_indices,
const std::vector< size_t > &  unused_transfers_indices 
) const
private

◆ get_output_relatedness()

float tools::wallet2::get_output_relatedness ( const transfer_details td0,
const transfer_details td1 
) const
private

◆ get_outs()

void tools::wallet2::get_outs ( std::vector< std::vector< get_outs_entry >> &  outs,
const std::list< size_t > &  selected_transfers,
size_t  fake_outputs_count 
)
private

◆ get_payment_id()

crypto::hash tools::wallet2::get_payment_id ( const pending_tx ptx) const
private

◆ get_payments() [1/2]

void tools::wallet2::get_payments ( const crypto::hash payment_id,
std::list< wallet2::payment_details > &  payments,
uint64_t  min_height = 0 
) const

◆ get_payments() [2/2]

void tools::wallet2::get_payments ( std::list< std::pair< crypto::hash, wallet2::payment_details >> &  payments,
uint64_t  min_height,
uint64_t  max_height = (uint64_t)-1 
) const

◆ get_payments_out()

void tools::wallet2::get_payments_out ( std::list< std::pair< crypto::hash, wallet2::confirmed_transfer_details >> &  confirmed_payments,
uint64_t  min_height,
uint64_t  max_height = (uint64_t)-1 
) const

◆ get_per_kb_fee()

uint64_t tools::wallet2::get_per_kb_fee ( )

◆ get_pruned_tx_blob()

cryptonote::blobdata tools::wallet2::get_pruned_tx_blob ( const cryptonote::blobdata blobdata)
private

◆ get_refresh_from_block_height()

uint64_t tools::wallet2::get_refresh_from_block_height ( ) const
inline

◆ get_refresh_type()

RefreshType tools::wallet2::get_refresh_type ( ) const
inline

◆ get_seed()

bool tools::wallet2::get_seed ( std::string &  electrum_words) const

◆ get_seed_language()

const std::string & tools::wallet2::get_seed_language ( ) const

Gets the seed language.

◆ get_short_chain_history()

void tools::wallet2::get_short_chain_history ( std::list< crypto::hash > &  ids) const
private

◆ get_short_payment_id()

crypto::hash8 tools::wallet2::get_short_payment_id ( const pending_tx ptx) const
private

◆ get_storage()

cryptonote::Blockchain* tools::wallet2::get_storage ( ) const
inline

◆ get_transfer_details()

const wallet2::transfer_details & tools::wallet2::get_transfer_details ( size_t  idx) const

◆ get_transfers()

void tools::wallet2::get_transfers ( wallet2::transfer_container incoming_transfers) const

◆ get_tx_key()

bool tools::wallet2::get_tx_key ( const crypto::hash txid,
crypto::secret_key tx_key 
) const

◆ get_tx_note()

std::string tools::wallet2::get_tx_note ( const crypto::hash txid) const

◆ get_tx_pub_key_from_received_outs()

crypto::public_key tools::wallet2::get_tx_pub_key_from_received_outs ( const tools::wallet2::transfer_details td) const
private

◆ get_unconfirmed_payments()

void tools::wallet2::get_unconfirmed_payments ( std::list< std::pair< crypto::hash, wallet2::payment_details >> &  unconfirmed_payments) const

◆ get_unconfirmed_payments_out()

void tools::wallet2::get_unconfirmed_payments_out ( std::list< std::pair< crypto::hash, wallet2::unconfirmed_transfer_details >> &  unconfirmed_payments) const

◆ get_unspent_amounts_vector()

std::vector< uint64_t > tools::wallet2::get_unspent_amounts_vector ( )
private

◆ get_upper_transaction_size_limit()

uint64_t tools::wallet2::get_upper_transaction_size_limit ( )
private

◆ get_wallet_file()

std::string tools::wallet2::get_wallet_file ( ) const

◆ has_testnet_option()

bool tools::wallet2::has_testnet_option ( const boost::program_options::variables_map &  vm)
static

◆ import_key_images() [1/2]

uint64_t tools::wallet2::import_key_images ( const std::vector< std::pair< crypto::key_image, crypto::signature >> &  signed_key_images,
uint64_t &  spent,
uint64_t &  unspent 
)

◆ import_key_images() [2/2]

uint64_t tools::wallet2::import_key_images ( const std::string &  filename,
uint64_t &  spent,
uint64_t &  unspent 
)

◆ import_outputs()

size_t tools::wallet2::import_outputs ( const std::vector< tools::wallet2::transfer_details > &  outputs)

◆ init()

bool tools::wallet2::init ( std::string  daemon_address = "http://localhost:8080",
boost::optional< epee::net_utils::http::login >  daemon_login = boost::none,
std::string  blockchain_db_path = "",
uint64_t  upper_transaction_size_limit = 0 
)

◆ init_options()

void tools::wallet2::init_options ( boost::program_options::options_description &  desc_params)
static

◆ is_deprecated()

bool tools::wallet2::is_deprecated ( ) const

Tells if the wallet file is deprecated.

◆ is_deterministic()

bool tools::wallet2::is_deterministic ( ) const

Checks if deterministic wallet.

◆ is_synced()

bool tools::wallet2::is_synced ( ) const

◆ is_transfer_unlocked()

bool tools::wallet2::is_transfer_unlocked ( const transfer_details td) const

◆ is_tx_spendtime_unlocked()

bool tools::wallet2::is_tx_spendtime_unlocked ( uint64_t  unlock_time,
uint64_t  block_height 
) const
private

◆ load()

void tools::wallet2::load ( const std::string &  wallet,
const std::string &  password 
)

◆ load_database()

void tools::wallet2::load_database ( const std::string  blockchain_db_path)
private

◆ load_keys()

bool tools::wallet2::load_keys ( const std::string &  keys_file_name,
const std::string &  password 
)
private

Load wallet information from wallet file.

Parameters
keys_file_nameName of wallet file
passwordPassword of wallet file

◆ load_tx()

bool tools::wallet2::load_tx ( const std::string &  signed_filename,
std::vector< tools::wallet2::pending_tx > &  ptx,
std::function< bool(const signed_tx_set &)>  accept_func = NULL 
)

◆ load_unsigned_tx()

bool tools::wallet2::load_unsigned_tx ( const std::string &  unsigned_filename,
unsigned_tx_set exported_txs 
)

◆ make_dummy()

std::unique_ptr< wallet2 > tools::wallet2::make_dummy ( const boost::program_options::variables_map &  vm,
etneg::MicroCore core = nullptr,
cryptonote::Blockchain blockchain_storage = nullptr 
)
static

Just parses variables.

◆ make_from_file()

std::pair< std::unique_ptr< wallet2 >, password_container > tools::wallet2::make_from_file ( const boost::program_options::variables_map &  vm,
const std::string &  wallet_file,
etneg::MicroCore core = nullptr,
cryptonote::Blockchain blockchain_storage = nullptr 
)
static

Uses stdin and stdout. Returns a wallet2 and password for wallet_file if no errors.

◆ make_from_json()

std::unique_ptr< wallet2 > tools::wallet2::make_from_json ( const boost::program_options::variables_map &  vm,
const std::string &  json_file,
etneg::MicroCore core = nullptr,
cryptonote::Blockchain blockchain_storage = nullptr 
)
static

Uses stdin and stdout. Returns a wallet2 if no errors.

◆ make_new()

std::pair< std::unique_ptr< wallet2 >, password_container > tools::wallet2::make_new ( const boost::program_options::variables_map &  vm,
etneg::MicroCore core = nullptr,
cryptonote::Blockchain blockchain_storage = nullptr 
)
static

Uses stdin and stdout. Returns a wallet2 and password for wallet with no file if no errors.

◆ make_uri()

std::string tools::wallet2::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 
)

◆ merge_destinations() [1/2]

void tools::wallet2::merge_destinations ( bool  merge)
inline

◆ merge_destinations() [2/2]

bool tools::wallet2::merge_destinations ( ) const
inline

◆ parse_block_round()

void tools::wallet2::parse_block_round ( const cryptonote::blobdata blob,
cryptonote::block bl,
crypto::hash bl_id,
bool error 
) const
private

◆ parse_long_payment_id()

bool tools::wallet2::parse_long_payment_id ( const std::string &  payment_id_str,
crypto::hash payment_id 
)
static

◆ parse_payment_id()

bool tools::wallet2::parse_payment_id ( const std::string &  payment_id_str,
crypto::hash payment_id 
)
static

◆ parse_short_payment_id()

bool tools::wallet2::parse_short_payment_id ( const std::string &  payment_id_str,
crypto::hash8 payment_id 
)
static

◆ parse_uri()

bool tools::wallet2::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 
)

◆ password_prompt()

boost::optional< password_container > tools::wallet2::password_prompt ( const bool  new_password)
static
Returns
Password retrieved from prompt. Logs error on failure.

◆ path()

std::string tools::wallet2::path ( ) const

◆ pick_preferred_rct_inputs()

std::vector< size_t > tools::wallet2::pick_preferred_rct_inputs ( uint64_t  needed_money) const
private

◆ pop_best_value()

size_t tools::wallet2::pop_best_value ( std::vector< size_t > &  unused_dust_indices,
const std::list< size_t > &  selected_transfers,
bool  smallest = false 
) const

◆ pop_best_value_from()

size_t tools::wallet2::pop_best_value_from ( const transfer_container transfers,
std::vector< size_t > &  unused_dust_indices,
const std::list< size_t > &  selected_transfers,
bool  smallest = false 
) const

◆ prepare_file_names()

bool tools::wallet2::prepare_file_names ( const std::string &  file_path)
private

◆ print_ring_members() [1/2]

bool tools::wallet2::print_ring_members ( ) const
inline

◆ print_ring_members() [2/2]

void tools::wallet2::print_ring_members ( bool  value)
inline

◆ process_blocks()

void tools::wallet2::process_blocks ( uint64_t  start_height,
const std::list< cryptonote::block_complete_entry > &  blocks,
const std::vector< cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices > &  o_indices,
uint64_t &  blocks_added 
)
private

◆ process_new_blockchain_entry()

void tools::wallet2::process_new_blockchain_entry ( const cryptonote::block b,
const cryptonote::block_complete_entry bche,
const crypto::hash bl_id,
uint64_t  height,
const cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices o_indices 
)
private

◆ process_new_transaction()

void tools::wallet2::process_new_transaction ( const crypto::hash txid,
const cryptonote::transaction tx,
const std::vector< uint64_t > &  o_indices,
uint64_t  height,
uint64_t  ts,
bool  miner_tx,
bool  pool 
)
private

◆ process_outgoing()

void tools::wallet2::process_outgoing ( const crypto::hash txid,
const cryptonote::transaction tx,
uint64_t  height,
uint64_t  ts,
uint64_t  spent,
uint64_t  received 
)
private

◆ process_unconfirmed()

void tools::wallet2::process_unconfirmed ( const crypto::hash txid,
const cryptonote::transaction tx,
uint64_t  height 
)
private

◆ pull_blocks()

void tools::wallet2::pull_blocks ( uint64_t  start_height,
uint64_t &  blocks_start_height,
const std::list< crypto::hash > &  short_chain_history,
std::list< cryptonote::block_complete_entry > &  blocks,
std::vector< cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices > &  o_indices 
)
private

◆ pull_hashes()

void tools::wallet2::pull_hashes ( uint64_t  start_height,
uint64_t &  blocks_start_height,
const std::list< crypto::hash > &  short_chain_history,
std::list< crypto::hash > &  hashes 
)
private

◆ pull_next_blocks()

void tools::wallet2::pull_next_blocks ( uint64_t  start_height,
uint64_t &  blocks_start_height,
std::list< crypto::hash > &  short_chain_history,
const std::list< cryptonote::block_complete_entry > &  prev_blocks,
std::list< cryptonote::block_complete_entry > &  blocks,
std::vector< cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices > &  o_indices,
bool error 
)
private

◆ refresh() [1/4]

void tools::wallet2::refresh ( )

◆ refresh() [2/4]

void tools::wallet2::refresh ( uint64_t  start_height,
uint64_t &  blocks_fetched 
)

◆ refresh() [3/4]

void tools::wallet2::refresh ( uint64_t  start_height,
uint64_t &  blocks_fetched,
bool received_money 
)

◆ refresh() [4/4]

bool tools::wallet2::refresh ( uint64_t &  blocks_fetched,
bool received_money,
bool ok 
)

◆ rescan_blockchain()

void tools::wallet2::rescan_blockchain ( bool  refresh = true)

◆ rescan_spent()

void tools::wallet2::rescan_spent ( )

◆ restricted()

bool tools::wallet2::restricted ( ) const
inline

◆ rewrite()

void tools::wallet2::rewrite ( const std::string &  wallet_name,
const std::string &  password 
)

Rewrites to the wallet file for wallet upgrade (doesn't generate key, assumes it's already there)

Parameters
wallet_nameName of wallet file (should exist)
passwordPassword for wallet file

◆ save_transfers_to_csv()

void tools::wallet2::save_transfers_to_csv ( bool  in,
bool  out,
uint64_t  min_height,
uint64_t  max_height 
)

◆ save_tx()

bool tools::wallet2::save_tx ( const std::vector< pending_tx > &  ptx_vector,
const std::string &  filename 
)

◆ select_available_mixable_outputs()

std::vector< size_t > tools::wallet2::select_available_mixable_outputs ( bool  trusted_daemon)

◆ select_available_outputs()

std::vector< size_t > tools::wallet2::select_available_outputs ( const std::function< bool(const transfer_details &td)> &  f)

◆ select_available_outputs_from_histogram()

std::vector< size_t > tools::wallet2::select_available_outputs_from_histogram ( uint64_t  count,
bool  atleast,
bool  unlocked,
bool  allow_rct,
bool  trusted_daemon 
)

◆ select_available_unmixable_outputs()

std::vector< size_t > tools::wallet2::select_available_unmixable_outputs ( bool  trusted_daemon)

◆ select_transfers()

uint64_t tools::wallet2::select_transfers ( uint64_t  needed_money,
std::vector< size_t >  unused_transfers_indices,
std::list< size_t > &  selected_transfers,
bool  trusted_daemon 
)
private

◆ serialize()

template<class t_archive >
void tools::wallet2::serialize ( t_archive &  a,
const unsigned int  ver 
)
inline

◆ set_blockchain_storage()

void tools::wallet2::set_blockchain_storage ( etneg::MicroCore core = nullptr,
cryptonote::Blockchain blockchain_storage = nullptr 
)

◆ set_default_decimal_point()

void tools::wallet2::set_default_decimal_point ( unsigned int  decimal_point)

◆ set_default_priority()

void tools::wallet2::set_default_priority ( uint32_t  p)
inline

◆ set_min_output_count()

void tools::wallet2::set_min_output_count ( uint32_t  count)
inline

◆ set_min_output_value()

void tools::wallet2::set_min_output_value ( uint64_t  value)
inline

◆ set_refresh_from_block_height()

void tools::wallet2::set_refresh_from_block_height ( uint64_t  height)
inline

◆ set_refresh_type()

void tools::wallet2::set_refresh_type ( RefreshType  refresh_type)
inline

◆ set_seed_language()

void tools::wallet2::set_seed_language ( const std::string &  language)

Sets the seed language.

Parameters
languageSeed language to set to

◆ set_spent()

void tools::wallet2::set_spent ( size_t  idx,
uint64_t  height 
)
private

◆ set_tx_note()

void tools::wallet2::set_tx_note ( const crypto::hash txid,
const std::string &  note 
)

◆ set_unspent()

void tools::wallet2::set_unspent ( size_t  idx)
private

◆ should_pick_a_second_output()

bool tools::wallet2::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
private

◆ sign()

std::string tools::wallet2::sign ( const std::string &  data) const

◆ sign_tx() [1/2]

bool tools::wallet2::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 
)

◆ sign_tx() [2/2]

bool tools::wallet2::sign_tx ( unsigned_tx_set exported_txs,
const std::string &  signed_filename,
std::vector< wallet2::pending_tx > &  ptx 
)

◆ stop()

void tools::wallet2::stop ( )
inline

◆ store()

void tools::wallet2::store ( )

◆ store_keys()

bool tools::wallet2::store_keys ( const std::string &  keys_file_name,
const std::string &  password,
bool  watch_only = false 
)
private

Stores wallet information to wallet file.

Parameters
keys_file_nameName of wallet file
passwordPassword of wallet file
watch_onlytrue to save only view key, false to save both spend and view keys
Returns
Whether it was successful.

◆ store_to()

void tools::wallet2::store_to ( const std::string &  path,
const std::string &  password 
)

store_to - stores wallet to another file(s), deleting old ones

Parameters
path- path to the wallet file (keys and address filenames will be generated based on this filename)
password- password to protect new wallet (TODO: probably better save the password in the wallet object?)

◆ store_tx_info() [1/2]

bool tools::wallet2::store_tx_info ( ) const
inline

◆ store_tx_info() [2/2]

void tools::wallet2::store_tx_info ( bool  store)
inline

◆ testnet()

bool tools::wallet2::testnet ( ) const
inline

◆ tr()

const char * tools::wallet2::tr ( const char *  str)
static

◆ transfer() [1/4]

template<typename T >
void tools::wallet2::transfer ( const std::vector< cryptonote::tx_destination_entry > &  dsts,
const size_t  fake_outputs_count,
const std::vector< size_t > &  unused_transfers_indices,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
T  destination_split_strategy,
const tx_dust_policy dust_policy,
bool  trusted_daemon 
)

◆ transfer() [2/4]

template<typename T >
void tools::wallet2::transfer ( const std::vector< cryptonote::tx_destination_entry > &  dsts,
const size_t  fake_outputs_count,
const std::vector< size_t > &  unused_transfers_indices,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
T  destination_split_strategy,
const tx_dust_policy dust_policy,
cryptonote::transaction tx,
pending_tx ptx,
bool  trusted_daemon 
)

◆ transfer() [3/4]

void tools::wallet2::transfer ( const std::vector< cryptonote::tx_destination_entry > &  dsts,
const size_t  fake_outputs_count,
const std::vector< size_t > &  unused_transfers_indices,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
bool  trusted_daemon 
)

◆ transfer() [4/4]

void tools::wallet2::transfer ( const std::vector< cryptonote::tx_destination_entry > &  dsts,
const size_t  fake_outputs_count,
const std::vector< size_t > &  unused_transfers_indices,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
cryptonote::transaction tx,
pending_tx ptx,
bool  trusted_daemon 
)

◆ transfer_selected() [1/2]

template<typename T >
void tools::wallet2::transfer_selected ( const std::vector< cryptonote::tx_destination_entry > &  dsts,
const std::list< size_t >  selected_transfers,
size_t  fake_outputs_count,
std::vector< std::vector< tools::wallet2::get_outs_entry >> &  outs,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
T  destination_split_strategy,
const tx_dust_policy dust_policy,
cryptonote::transaction tx,
pending_tx ptx 
)

◆ transfer_selected() [2/2]

template<typename T >
void tools::wallet2::transfer_selected ( const std::vector< cryptonote::tx_destination_entry > &  dsts,
const std::list< size_t >  selected_transfers,
size_t  fake_outputs_count,
std::vector< std::vector< tools::wallet2::get_outs_entry >> &  outs,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
T  destination_split_strategy,
const tx_dust_policy dust_policy,
cryptonote::transaction tx,
pending_tx ptx 
)

◆ transfer_selected_rct()

void tools::wallet2::transfer_selected_rct ( std::vector< cryptonote::tx_destination_entry dsts,
const std::list< size_t >  selected_transfers,
size_t  fake_outputs_count,
std::vector< std::vector< tools::wallet2::get_outs_entry >> &  outs,
uint64_t  unlock_time,
uint64_t  fee,
const std::vector< uint8_t > &  extra,
cryptonote::transaction tx,
pending_tx ptx 
)

◆ unlocked_balance()

uint64_t tools::wallet2::unlocked_balance ( ) const

◆ unlocked_dust_balance()

uint64_t tools::wallet2::unlocked_dust_balance ( const tx_dust_policy dust_policy) const

◆ update_pool_state()

void tools::wallet2::update_pool_state ( bool  refreshed = false)

◆ use_fork_rules()

bool tools::wallet2::use_fork_rules ( uint8_t  version,
int64_t  early_blocks = 0 
)

◆ verify()

bool tools::wallet2::verify ( const std::string &  data,
const cryptonote::account_public_address address,
const std::string &  signature 
) const

◆ verify_password() [1/2]

bool tools::wallet2::verify_password ( const std::string &  keys_file_name,
const std::string &  password,
bool  watch_only 
)
static

verify password for specified wallet keys file.

Parameters
keys_file_nameKeys file to verify password for
passwordPassword to verify
watch_onlyIf set = only verify view keys, otherwise also spend keys
Returns
true if password is correct

for verification only should not mutate state, unlike load_keys() can be used prior to rewriting wallet keys file, to ensure user has entered the correct password

◆ verify_password() [2/2]

bool tools::wallet2::verify_password ( const std::string &  password) const

verifies given password is correct for default wallet keys file

verify password for default wallet keys file.

Parameters
passwordPassword to verify
Returns
true if password is correct

for verification only should not mutate state, unlike load_keys() can be used prior to rewriting wallet keys file, to ensure user has entered the correct password

◆ wallet_exists()

void tools::wallet2::wallet_exists ( const std::string &  file_path,
bool keys_file_exists,
bool wallet_file_exists 
)
static

Check if wallet keys and bin files exist.

Parameters
file_pathWallet file path
keys_file_existsWhether keys file exists
wallet_file_existsWhether bin file exists

◆ wallet_generate_key_image_helper()

bool tools::wallet2::wallet_generate_key_image_helper ( const cryptonote::account_keys ack,
const crypto::public_key tx_public_key,
size_t  real_output_index,
cryptonote::keypair in_ephemeral,
crypto::key_image ki 
)
private

◆ wallet_valid_path_format()

bool tools::wallet2::wallet_valid_path_format ( const std::string &  file_path)
static

◆ watch_only()

bool tools::wallet2::watch_only ( ) const
inline

◆ write_watch_only_wallet()

void tools::wallet2::write_watch_only_wallet ( const std::string &  wallet_name,
const std::string &  password 
)

Writes to a file named based on the normal wallet (doesn't generate key, assumes it's already there)

Parameters
wallet_nameBase name of wallet file
passwordPassword for wallet file

Friends And Related Function Documentation

◆ ::Serialization_portability_wallet_Test

friend class ::Serialization_portability_wallet_Test
friend

Member Data Documentation

◆ is_connected_to_db

bool tools::wallet2::is_connected_to_db = false
private

◆ is_old_file_format

bool tools::wallet2::is_old_file_format
private

Whether the wallet file is of an old file format

◆ m_account

cryptonote::account_base tools::wallet2::m_account
private

◆ m_account_public_address

cryptonote::account_public_address tools::wallet2::m_account_public_address
private

◆ m_address_book

std::vector<tools::wallet2::address_book_row> tools::wallet2::m_address_book
private

◆ m_always_confirm_transfers

bool tools::wallet2::m_always_confirm_transfers
private

◆ m_ask_password

bool tools::wallet2::m_ask_password
private

◆ m_auto_refresh

bool tools::wallet2::m_auto_refresh
private

◆ m_blockchain

std::vector<crypto::hash> tools::wallet2::m_blockchain
private

◆ m_blockchain_storage

cryptonote::Blockchain* tools::wallet2::m_blockchain_storage
private

◆ m_callback

i_wallet2_callback* tools::wallet2::m_callback
private

◆ m_confirm_backlog

bool tools::wallet2::m_confirm_backlog
private

◆ m_confirm_missing_payment_id

bool tools::wallet2::m_confirm_missing_payment_id
private

◆ m_confirmed_txs

std::unordered_map<crypto::hash, confirmed_transfer_details> tools::wallet2::m_confirmed_txs
private

◆ m_core

etneg::MicroCore* tools::wallet2::m_core
private

◆ m_daemon_address

std::string tools::wallet2::m_daemon_address
private

◆ m_daemon_login

boost::optional<epee::net_utils::http::login> tools::wallet2::m_daemon_login
private

◆ m_daemon_rpc_mutex

boost::mutex tools::wallet2::m_daemon_rpc_mutex
private

◆ m_default_priority

uint32_t tools::wallet2::m_default_priority
private

◆ m_display_progress_indicator

bool tools::wallet2::m_display_progress_indicator
private

◆ m_http_client

epee::net_utils::http::http_simple_client tools::wallet2::m_http_client
private

◆ m_is_initialized

bool tools::wallet2::m_is_initialized
private

◆ m_key_images

std::unordered_map<crypto::key_image, size_t> tools::wallet2::m_key_images
private

◆ m_keys_file

std::string tools::wallet2::m_keys_file
private

◆ m_local_bc_height

std::atomic<uint64_t> tools::wallet2::m_local_bc_height
private

◆ m_merge_destinations

bool tools::wallet2::m_merge_destinations
private

◆ m_min_output_count

uint32_t tools::wallet2::m_min_output_count
private

◆ m_min_output_value

uint64_t tools::wallet2::m_min_output_value
private

◆ m_node_rpc_proxy

NodeRPCProxy tools::wallet2::m_node_rpc_proxy
private

◆ m_payments

payment_container tools::wallet2::m_payments
private

◆ m_physical_refresh

bool tools::wallet2::m_physical_refresh
private

◆ m_print_ring_members

bool tools::wallet2::m_print_ring_members
private

◆ m_pub_keys

std::unordered_map<crypto::public_key, size_t> tools::wallet2::m_pub_keys
private

◆ m_refresh_from_block_height

uint64_t tools::wallet2::m_refresh_from_block_height
private

◆ m_refresh_type

RefreshType tools::wallet2::m_refresh_type
private

◆ m_restricted

bool tools::wallet2::m_restricted
private

◆ m_run

std::atomic<bool> tools::wallet2::m_run
private

◆ m_scanned_pool_txs

std::unordered_set<crypto::hash> tools::wallet2::m_scanned_pool_txs[2]
private

◆ m_store_tx_info

bool tools::wallet2::m_store_tx_info
private

request txkey to be returned in RPC, and store in the wallet cache file

◆ m_testnet

bool tools::wallet2::m_testnet
private

◆ m_transfers

transfer_container tools::wallet2::m_transfers
private

◆ m_tx_keys

std::unordered_map<crypto::hash, crypto::secret_key> tools::wallet2::m_tx_keys
private

◆ m_tx_notes

std::unordered_map<crypto::hash, std::string> tools::wallet2::m_tx_notes
private

◆ m_unconfirmed_payments

std::unordered_multimap<crypto::hash, payment_details> tools::wallet2::m_unconfirmed_payments
private

◆ m_unconfirmed_txs

std::unordered_map<crypto::hash, unconfirmed_transfer_details> tools::wallet2::m_unconfirmed_txs
private

◆ m_upper_transaction_size_limit

uint64_t tools::wallet2::m_upper_transaction_size_limit
private

◆ m_wallet_file

std::string tools::wallet2::m_wallet_file
private

◆ m_watch_only

bool tools::wallet2::m_watch_only
private

no spend key

◆ rpc_timeout

constexpr const std::chrono::seconds tools::wallet2::rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30)
static

◆ seed_language

std::string tools::wallet2::seed_language
private

Language of the mnemonics (seed).


The documentation for this class was generated from the following files: