Monero
simplewallet.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2018, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
36 #pragma once
37 
38 #include <memory>
39 
40 #include <boost/optional/optional.hpp>
41 #include <boost/program_options/variables_map.hpp>
42 
45 #include "wallet/wallet2.h"
46 #include "console_handler.h"
47 #include "wipeable_string.h"
48 #include "common/i18n.h"
49 #include "common/password.h"
50 #include "crypto/crypto.h" // for definition of crypto::secret_key
51 
52 #undef MONERO_DEFAULT_LOG_CATEGORY
53 #define MONERO_DEFAULT_LOG_CATEGORY "wallet.simplewallet"
54 // Hardcode Monero's donation address (see #1447)
55 constexpr const char MONERO_DONATION_ADDR[] = "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A";
56 
61 namespace cryptonote
62 {
67  {
68  public:
69  static const char *tr(const char *str) { return i18n_translate(str, "cryptonote::simple_wallet"); }
70 
71  public:
72  typedef std::vector<std::string> command_type;
73 
74  simple_wallet();
75  bool init(const boost::program_options::variables_map& vm);
76  bool deinit();
77  bool run();
78  void stop();
79  void interrupt();
80 
81  //wallet *create_wallet();
82  bool process_command(const std::vector<std::string> &args);
83  std::string get_commands_str();
84  std::string get_command_usage(const std::vector<std::string> &args);
85  private:
86  bool handle_command_line(const boost::program_options::variables_map& vm);
87 
88  bool run_console_handler();
89 
90  void wallet_idle_thread();
91 
93  boost::optional<tools::password_container> get_and_verify_password() const;
94 
95  boost::optional<epee::wipeable_string> new_wallet(const boost::program_options::variables_map& vm, const crypto::secret_key& recovery_key,
96  bool recover, bool two_random, const std::string &old_language);
97  boost::optional<epee::wipeable_string> new_wallet(const boost::program_options::variables_map& vm, const cryptonote::account_public_address& address,
98  const boost::optional<crypto::secret_key>& spendkey, const crypto::secret_key& viewkey);
99  boost::optional<epee::wipeable_string> new_wallet(const boost::program_options::variables_map& vm,
100  const epee::wipeable_string &multisig_keys, const std::string &old_language);
101  boost::optional<epee::wipeable_string> new_wallet(const boost::program_options::variables_map& vm);
102  bool open_wallet(const boost::program_options::variables_map& vm);
103  bool close_wallet();
104 
105  bool viewkey(const std::vector<std::string> &args = std::vector<std::string>());
106  bool spendkey(const std::vector<std::string> &args = std::vector<std::string>());
107  bool seed(const std::vector<std::string> &args = std::vector<std::string>());
108  bool encrypted_seed(const std::vector<std::string> &args = std::vector<std::string>());
109 
119  bool seed_set_language(const std::vector<std::string> &args = std::vector<std::string>());
120  bool set_always_confirm_transfers(const std::vector<std::string> &args = std::vector<std::string>());
121  bool set_print_ring_members(const std::vector<std::string> &args = std::vector<std::string>());
122  bool set_store_tx_info(const std::vector<std::string> &args = std::vector<std::string>());
123  bool set_default_ring_size(const std::vector<std::string> &args = std::vector<std::string>());
124  bool set_auto_refresh(const std::vector<std::string> &args = std::vector<std::string>());
125  bool set_refresh_type(const std::vector<std::string> &args = std::vector<std::string>());
126  bool set_confirm_missing_payment_id(const std::vector<std::string> &args = std::vector<std::string>());
127  bool set_ask_password(const std::vector<std::string> &args = std::vector<std::string>());
128  bool set_unit(const std::vector<std::string> &args = std::vector<std::string>());
129  bool set_min_output_count(const std::vector<std::string> &args = std::vector<std::string>());
130  bool set_min_output_value(const std::vector<std::string> &args = std::vector<std::string>());
131  bool set_merge_destinations(const std::vector<std::string> &args = std::vector<std::string>());
132  bool set_confirm_backlog(const std::vector<std::string> &args = std::vector<std::string>());
133  bool set_confirm_backlog_threshold(const std::vector<std::string> &args = std::vector<std::string>());
134  bool set_confirm_export_overwrite(const std::vector<std::string> &args = std::vector<std::string>());
135  bool set_refresh_from_block_height(const std::vector<std::string> &args = std::vector<std::string>());
136  bool set_auto_low_priority(const std::vector<std::string> &args = std::vector<std::string>());
137  bool set_segregate_pre_fork_outputs(const std::vector<std::string> &args = std::vector<std::string>());
138  bool set_key_reuse_mitigation2(const std::vector<std::string> &args = std::vector<std::string>());
139  bool set_subaddress_lookahead(const std::vector<std::string> &args = std::vector<std::string>());
140  bool set_segregation_height(const std::vector<std::string> &args = std::vector<std::string>());
141  bool set_ignore_fractional_outputs(const std::vector<std::string> &args = std::vector<std::string>());
142  bool help(const std::vector<std::string> &args = std::vector<std::string>());
143  bool start_mining(const std::vector<std::string> &args);
144  bool stop_mining(const std::vector<std::string> &args);
145  bool set_daemon(const std::vector<std::string> &args);
146  bool save_bc(const std::vector<std::string> &args);
147  bool refresh(const std::vector<std::string> &args);
148  bool show_balance_unlocked(bool detailed = false);
149  bool show_balance(const std::vector<std::string> &args = std::vector<std::string>());
150  bool show_incoming_transfers(const std::vector<std::string> &args);
151  bool show_payments(const std::vector<std::string> &args);
152  bool show_blockchain_height(const std::vector<std::string> &args);
153  bool transfer_main(int transfer_type, const std::vector<std::string> &args);
154  bool transfer(const std::vector<std::string> &args);
155  bool locked_transfer(const std::vector<std::string> &args);
156  bool locked_sweep_all(const std::vector<std::string> &args);
157  bool sweep_main(uint64_t below, bool locked, const std::vector<std::string> &args);
158  bool sweep_all(const std::vector<std::string> &args);
159  bool sweep_below(const std::vector<std::string> &args);
160  bool sweep_single(const std::vector<std::string> &args);
161  bool sweep_unmixable(const std::vector<std::string> &args);
162  bool donate(const std::vector<std::string> &args);
163  bool sign_transfer(const std::vector<std::string> &args);
164  bool submit_transfer(const std::vector<std::string> &args);
165  std::vector<std::vector<cryptonote::tx_destination_entry>> split_amounts(
166  std::vector<cryptonote::tx_destination_entry> dsts, size_t num_splits
167  );
168  bool account(const std::vector<std::string> &args = std::vector<std::string>());
169  void print_accounts();
170  void print_accounts(const std::string& tag);
171  bool print_address(const std::vector<std::string> &args = std::vector<std::string>());
172  bool print_integrated_address(const std::vector<std::string> &args = std::vector<std::string>());
173  bool address_book(const std::vector<std::string> &args = std::vector<std::string>());
174  bool save(const std::vector<std::string> &args);
175  bool save_watch_only(const std::vector<std::string> &args);
176  bool set_variable(const std::vector<std::string> &args);
177  bool rescan_spent(const std::vector<std::string> &args);
178  bool set_log(const std::vector<std::string> &args);
179  bool get_tx_key(const std::vector<std::string> &args);
180  bool set_tx_key(const std::vector<std::string> &args);
181  bool check_tx_key(const std::vector<std::string> &args);
182  bool get_tx_proof(const std::vector<std::string> &args);
183  bool check_tx_proof(const std::vector<std::string> &args);
184  bool get_spend_proof(const std::vector<std::string> &args);
185  bool check_spend_proof(const std::vector<std::string> &args);
186  bool get_reserve_proof(const std::vector<std::string> &args);
187  bool check_reserve_proof(const std::vector<std::string> &args);
188  bool show_transfers(const std::vector<std::string> &args);
189  bool unspent_outputs(const std::vector<std::string> &args);
190  bool rescan_blockchain(const std::vector<std::string> &args);
191  bool refresh_main(uint64_t start_height, bool reset = false, bool is_init = false);
192  bool set_tx_note(const std::vector<std::string> &args);
193  bool get_tx_note(const std::vector<std::string> &args);
194  bool set_description(const std::vector<std::string> &args);
195  bool get_description(const std::vector<std::string> &args);
196  bool status(const std::vector<std::string> &args);
197  bool wallet_info(const std::vector<std::string> &args);
198  bool set_default_priority(const std::vector<std::string> &args);
199  bool sign(const std::vector<std::string> &args);
200  bool verify(const std::vector<std::string> &args);
201  bool export_key_images(const std::vector<std::string> &args);
202  bool import_key_images(const std::vector<std::string> &args);
203  bool hw_reconnect(const std::vector<std::string> &args);
204  bool export_outputs(const std::vector<std::string> &args);
205  bool import_outputs(const std::vector<std::string> &args);
206  bool show_transfer(const std::vector<std::string> &args);
207  bool change_password(const std::vector<std::string>& args);
208  bool payment_id(const std::vector<std::string> &args);
209  bool print_fee_info(const std::vector<std::string> &args);
210  bool prepare_multisig(const std::vector<std::string>& args);
211  bool make_multisig(const std::vector<std::string>& args);
212  bool finalize_multisig(const std::vector<std::string> &args);
213  bool export_multisig(const std::vector<std::string>& args);
214  bool import_multisig(const std::vector<std::string>& args);
216  bool sign_multisig(const std::vector<std::string>& args);
217  bool submit_multisig(const std::vector<std::string>& args);
218  bool export_raw_multisig(const std::vector<std::string>& args);
219  bool print_ring(const std::vector<std::string>& args);
220  bool set_ring(const std::vector<std::string>& args);
221  bool save_known_rings(const std::vector<std::string>& args);
222  bool blackball(const std::vector<std::string>& args);
223  bool unblackball(const std::vector<std::string>& args);
224  bool blackballed(const std::vector<std::string>& args);
225  bool version(const std::vector<std::string>& args);
226 
227  uint64_t get_daemon_blockchain_height(std::string& err);
228  bool try_connect_to_daemon(bool silent = false, uint32_t* version = nullptr);
230  bool accept_loaded_tx(const std::function<size_t()> get_num_txes, const std::function<const tools::wallet2::tx_construction_data&(size_t)> &get_tx, const std::string &extra_message = std::string());
233  bool print_ring_members(const std::vector<tools::wallet2::pending_tx>& ptx_vector, std::ostream& ostr);
234  std::string get_prompt() const;
235  bool print_seed(bool encrypted);
236 
241  void print_seed(const epee::wipeable_string &seed);
242 
250  std::string get_mnemonic_language();
251 
256  void commit_or_save(std::vector<tools::wallet2::pending_tx>& ptx_vector, bool do_not_relay);
257 
258  //----------------- i_wallet2_callback ---------------------
259  virtual void on_new_block(uint64_t height, const cryptonote::block& block);
260  virtual void on_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, const cryptonote::subaddress_index& subaddr_index);
261  virtual void on_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, const cryptonote::subaddress_index& subaddr_index);
262  virtual void on_money_spent(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& in_tx, uint64_t amount, const cryptonote::transaction& spend_tx, const cryptonote::subaddress_index& subaddr_index);
263  virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx);
264  virtual boost::optional<epee::wipeable_string> on_get_password(const char *reason);
265  //----------------------------------------------------------
266 
268 
270  {
271  public:
276  , m_print_time()
277  {
278  }
279 
280  void update(uint64_t height, bool force = false)
281  {
282  auto current_time = std::chrono::system_clock::now();
283  const auto node_update_threshold = std::chrono::seconds(DIFFICULTY_TARGET_V1 / 2); // use min of V1/V2
284  if (node_update_threshold < current_time - m_blockchain_height_update_time || m_blockchain_height <= height)
285  {
288  }
289 
290  if (std::chrono::milliseconds(20) < current_time - m_print_time || force)
291  {
292  std::cout << QT_TRANSLATE_NOOP("cryptonote::simple_wallet", "Height ") << height << " / " << m_blockchain_height << '\r' << std::flush;
293  m_print_time = current_time;
294  }
295  }
296 
297  private:
299  {
300  std::string err;
301  uint64_t blockchain_height = m_simple_wallet.get_daemon_blockchain_height(err);
302  if (err.empty())
303  {
304  m_blockchain_height = blockchain_height;
305  m_blockchain_height_update_time = std::chrono::system_clock::now();
306  }
307  else
308  {
309  LOG_ERROR("Failed to get current blockchain height: " << err);
310  }
311  }
312 
313  private:
316  std::chrono::system_clock::time_point m_blockchain_height_update_time;
317  std::chrono::system_clock::time_point m_print_time;
318  };
319 
320  private:
321  std::string m_wallet_file;
322  std::string m_generate_new;
326  std::string m_generate_from_keys;
328  std::string m_generate_from_json;
329  std::string m_mnemonic_language;
330  std::string m_import_path;
332 
333  epee::wipeable_string m_electrum_seed; // electrum-style seed parameter
334 
335  crypto::secret_key m_recovery_key; // recovery key (used as random for wallet gen)
336  bool m_restore_deterministic_wallet; // recover flag
337  bool m_restore_multisig_wallet; // recover flag
338  bool m_non_deterministic; // old 2-random generation
340  bool m_restoring; // are we restoring, by whatever method?
341  uint64_t m_restore_height; // optional
344 
345  epee::console_handlers_binder m_cmd_binder;
346 
347  std::unique_ptr<tools::wallet2> m_wallet;
349 
350  std::atomic<bool> m_idle_run;
351  boost::thread m_idle_thread;
352  boost::mutex m_idle_mutex;
353  boost::condition_variable m_idle_cond;
354 
355  std::atomic<bool> m_auto_refresh_enabled;
357  std::atomic<bool> m_in_manual_refresh;
359  };
360 }
std::vector< std::vector< cryptonote::tx_destination_entry > > split_amounts(std::vector< cryptonote::tx_destination_entry > dsts, size_t num_splits)
bool run()
Definition: simplewallet.cpp:7018
bool show_blockchain_height(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4520
Definition: wallet2.h:427
bool sign_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5993
std::string m_import_path
Definition: simplewallet.h:330
static const char * tr(const char *str)
Definition: simplewallet.h:69
Definition: wallet2.h:421
bool show_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7878
bool show_incoming_transfers(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4354
bool get_tx_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6191
#define QT_TRANSLATE_NOOP(context, str)
Definition: i18n.h:31
bool set_default_priority(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1884
std::string m_generate_from_spend_key
Definition: simplewallet.h:325
bool m_restore_deterministic_wallet
Definition: simplewallet.h:336
bool set_ring(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1445
bool make_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:915
bool ask_wallet_create_if_needed()
Definition: simplewallet.cpp:2743
boost::optional< epee::wipeable_string > new_wallet(const boost::program_options::variables_map &vm, const crypto::secret_key &recovery_key, bool recover, bool two_random, const std::string &old_language)
Definition: simplewallet.cpp:3559
bool check_reserve_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6546
bool set_min_output_value(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2069
bool set_subaddress_lookahead(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2200
std::unique_ptr< tools::wallet2 > m_wallet
Definition: simplewallet.h:347
bool import_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1096
bool get_description(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7550
bool set_segregation_height(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2215
bool save(const std::vector< std::string > &args)
Definition: simplewallet.cpp:3925
std::string m_generate_from_multisig_keys
Definition: simplewallet.h:327
Definition: cryptonote_basic.h:366
bool m_non_deterministic
Definition: simplewallet.h:338
bool address_book(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7403
bool start_mining(const std::vector< std::string > &args)
Definition: simplewallet.cpp:3972
bool set_ask_password(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1989
std::string get_command_usage(const std::vector< std::string > &args)
Definition: simplewallet.cpp:604
uint64_t height
Definition: blockchain.cpp:88
bool spendkey(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:642
bool unblackball(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1716
std::string m_generate_new
Definition: simplewallet.h:322
bool set_store_tx_info(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1819
#define DIFFICULTY_TARGET_V1
Definition: cryptonote_config.h:78
bool export_key_images(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7693
bool set_unit(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2021
std::string m_generate_from_device
Definition: simplewallet.h:323
bool import_outputs(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7841
std::string get_mnemonic_language()
Gets the word seed language from the user.
Definition: simplewallet.cpp:3507
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:69
bool m_auto_refresh_refreshing
Definition: simplewallet.h:356
bool set_refresh_from_block_height(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2144
bool set_variable(const std::vector< std::string > &args)
Definition: simplewallet.cpp:2609
bool set_confirm_backlog(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2100
bool encrypted_seed(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:728
bool wallet_info(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7592
bool process_command(const std::vector< std::string > &args)
Definition: simplewallet.cpp:8027
uint64_t m_restore_height
Definition: simplewallet.h:341
bool locked_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5135
virtual void on_money_spent(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &in_tx, uint64_t amount, const cryptonote::transaction &spend_tx, const cryptonote::subaddress_index &subaddr_index)
Definition: simplewallet.cpp:4179
uint64_t m_blockchain_height
Definition: simplewallet.h:315
bool save_known_rings(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1773
bool seed_set_language(const std::vector< std::string > &args=std::vector< std::string >())
Sets seed language.
Definition: simplewallet.cpp:733
bool set_print_ring_members(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1806
bool m_use_english_language_names
Definition: simplewallet.h:343
const char * i18n_translate(const char *s, const std::string &context)
Definition: i18n.cpp:309
bool set_tx_note(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7481
bool open_wallet(const boost::program_options::variables_map &vm)
Definition: simplewallet.cpp:3791
bool donate(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5807
bool accept_loaded_tx(const tools::wallet2::multisig_tx_set &txs)
Definition: simplewallet.cpp:1170
bool set_refresh_type(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1959
bool sweep_single(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5552
Definition: wallet2.h:84
bool set_confirm_missing_payment_id(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1976
bool stop_mining(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4031
bool set_min_output_count(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2051
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:224
bool unspent_outputs(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6827
bool close_wallet()
Definition: simplewallet.cpp:3892
uint64_t get_daemon_blockchain_height(std::string &err)
Definition: simplewallet.cpp:4511
virtual void on_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx, uint64_t amount, const cryptonote::subaddress_index &subaddr_index)
Definition: simplewallet.cpp:4174
std::chrono::system_clock::time_point m_print_time
Definition: simplewallet.h:317
bool export_raw_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1317
Manages wallet operations. This is the most abstracted wallet class.
Definition: simplewallet.h:66
bool transfer_main(int transfer_type, const std::vector< std::string > &args)
Definition: simplewallet.cpp:4694
std::string m_wallet_file
Definition: simplewallet.h:321
bool export_outputs(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7802
virtual void on_money_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx, uint64_t amount, const cryptonote::subaddress_index &subaddr_index)
Definition: simplewallet.cpp:4143
Definition: wallet2.h:338
bool hw_reconnect(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7777
bool transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5130
void update(uint64_t height, bool force=false)
Definition: simplewallet.h:280
bool sweep_unmixable(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5146
bool try_connect_to_daemon(bool silent=false, uint32_t *version=nullptr)
Definition: simplewallet.cpp:3478
bool status(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7567
simple_wallet()
Definition: simplewallet.cpp:2258
bool get_spend_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6402
bool print_ring(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1394
virtual boost::optional< epee::wipeable_string > on_get_password(const char *reason)
Definition: simplewallet.cpp:4196
bool finalize_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:993
boost::thread m_idle_thread
Definition: simplewallet.h:351
boost::condition_variable m_idle_cond
Definition: simplewallet.h:353
bool version(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1787
bool set_key_reuse_mitigation2(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2187
bool help(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2245
void print_accounts()
Definition: simplewallet.cpp:7197
bool set_merge_destinations(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2087
void wallet_idle_thread()
Definition: simplewallet.cpp:6978
bool blackball(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1627
bool seed(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:723
bool set_confirm_backlog_threshold(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2113
constexpr const char MONERO_DONATION_ADDR[]
Definition: simplewallet.h:55
bool rescan_spent(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4534
bool set_segregate_pre_fork_outputs(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2174
bool export_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1045
Definition: subaddress_index.h:38
bool init(const boost::program_options::variables_map &vm)
Definition: simplewallet.cpp:2864
virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx)
Definition: simplewallet.cpp:4192
bool m_restore_multisig_wallet
Definition: simplewallet.h:337
void update_blockchain_height()
Definition: simplewallet.h:298
bool m_restoring
Definition: simplewallet.h:340
bool print_seed(bool encrypted)
Definition: simplewallet.cpp:664
std::string m_subaddress_lookahead
Definition: simplewallet.h:331
refresh_progress_reporter_t m_refresh_progress_reporter
Definition: simplewallet.h:348
bool sweep_main(uint64_t below, bool locked, const std::vector< std::string > &args)
Definition: simplewallet.cpp:5252
bool get_tx_key(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6092
bool check_spend_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6451
bool set_log(const std::vector< std::string > &args)
Definition: simplewallet.cpp:2714
std::string m_generate_from_json
Definition: simplewallet.h:328
bool get_tx_note(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7509
bool show_balance(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:4342
std::atomic< bool > m_in_manual_refresh
Definition: simplewallet.h:357
Definition: wallet2.h:415
bool get_reserve_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6492
bool save_bc(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4116
std::atomic< bool > m_auto_refresh_enabled
Definition: simplewallet.h:355
bool sign_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1176
std::string get_prompt() const
Definition: simplewallet.cpp:7006
bool set_confirm_export_overwrite(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2131
bool show_payments(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4457
Definition: cryptonote_basic.h:400
bool m_do_not_relay
Definition: simplewallet.h:342
bool set_daemon(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4053
std::chrono::system_clock::time_point m_blockchain_height_update_time
Definition: simplewallet.h:316
cryptonote::simple_wallet & m_simple_wallet
Definition: simplewallet.h:314
bool refresh_main(uint64_t start_height, bool reset=false, bool is_init=false)
Definition: simplewallet.cpp:4222
bool verify(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7655
bool blackballed(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1743
bool viewkey(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:625
std::string get_commands_str()
Definition: simplewallet.cpp:593
bool import_key_images(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7735
bool check_tx_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6324
void stop()
Definition: simplewallet.cpp:7032
bool set_auto_low_priority(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2161
bool sweep_all(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5786
boost::optional< tools::password_container > get_and_verify_password() const
Definition: simplewallet.cpp:3545
bool print_ring_members(const std::vector< tools::wallet2::pending_tx > &ptx_vector, std::ostream &ostr)
Definition: simplewallet.cpp:4581
std::string m_generate_from_keys
Definition: simplewallet.h:326
bool rescan_blockchain(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6965
bool save_watch_only(const std::vector< std::string > &args)
Definition: simplewallet.cpp:3941
bool submit_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1249
bool print_integrated_address(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7353
bool refresh(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4296
bool set_tx_key(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6133
boost::mutex m_idle_mutex
Definition: simplewallet.h:352
void commit_or_save(std::vector< tools::wallet2::pending_tx > &ptx_vector, bool do_not_relay)
When –do-not-relay option is specified, save the raw tx hex blob to a file instead of calling m_wall...
Definition: simplewallet.cpp:8044
POD_CLASS hash
Definition: hash.h:49
std::string m_mnemonic_language
Definition: simplewallet.h:329
bool change_password(const std::vector< std::string > &args)
Definition: simplewallet.cpp:783
bool sweep_below(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5791
std::vector< std::string > command_type
Definition: simplewallet.h:72
bool account(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7043
bool submit_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6057
std::atomic< bool > m_idle_run
Definition: simplewallet.h:350
bool sign(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7618
bool check_tx_key(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6236
bool print_fee_info(const std::vector< std::string > &args)
Definition: simplewallet.cpp:824
bool set_default_ring_size(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1838
crypto::secret_key m_recovery_key
Definition: simplewallet.h:335
uint32_t m_current_subaddress_account
Definition: simplewallet.h:358
bool set_always_confirm_transfers(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1793
epee::console_handlers_binder m_cmd_binder
Definition: simplewallet.h:345
std::string m_generate_from_view_key
Definition: simplewallet.h:324
bool payment_id(const std::vector< std::string > &args)
Definition: simplewallet.cpp:811
bool handle_command_line(const boost::program_options::variables_map &vm)
Definition: simplewallet.cpp:3446
bool set_description(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7534
bool deinit()
Definition: simplewallet.cpp:3438
bool show_transfers(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6633
epee::wipeable_string m_electrum_seed
Definition: simplewallet.h:333
bool locked_sweep_all(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5140
Definition: cryptonote_basic.h:182
bool print_address(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7253
void interrupt()
Definition: simplewallet.cpp:8032
bool m_allow_mismatched_daemon_version
Definition: simplewallet.h:339
bool set_auto_refresh(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1940
virtual void on_new_block(uint64_t height, const cryptonote::block &block)
Definition: simplewallet.cpp:4137
bool set_ignore_fractional_outputs(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2232
refresh_progress_reporter_t(cryptonote::simple_wallet &simple_wallet)
Definition: simplewallet.h:272
bool prepare_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:882
bool show_balance_unlocked(bool detailed=false)
Definition: simplewallet.cpp:4312