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 exchange_multisig_keys(const std::vector<std::string> &args);
214  bool export_multisig(const std::vector<std::string>& args);
215  bool import_multisig(const std::vector<std::string>& args);
217  bool sign_multisig(const std::vector<std::string>& args);
218  bool submit_multisig(const std::vector<std::string>& args);
219  bool export_raw_multisig(const std::vector<std::string>& args);
220  bool print_ring(const std::vector<std::string>& args);
221  bool set_ring(const std::vector<std::string>& args);
222  bool save_known_rings(const std::vector<std::string>& args);
223  bool blackball(const std::vector<std::string>& args);
224  bool unblackball(const std::vector<std::string>& args);
225  bool blackballed(const std::vector<std::string>& args);
226  bool version(const std::vector<std::string>& args);
227 
228  uint64_t get_daemon_blockchain_height(std::string& err);
229  bool try_connect_to_daemon(bool silent = false, uint32_t* version = nullptr);
231  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());
234  bool print_ring_members(const std::vector<tools::wallet2::pending_tx>& ptx_vector, std::ostream& ostr);
235  std::string get_prompt() const;
236  bool print_seed(bool encrypted);
237 
242  void print_seed(const epee::wipeable_string &seed);
243 
251  std::string get_mnemonic_language();
252 
257  void commit_or_save(std::vector<tools::wallet2::pending_tx>& ptx_vector, bool do_not_relay);
258 
259  //----------------- i_wallet2_callback ---------------------
260  virtual void on_new_block(uint64_t height, const cryptonote::block& block);
261  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);
262  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);
263  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);
264  virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx);
265  virtual boost::optional<epee::wipeable_string> on_get_password(const char *reason);
266  //----------------------------------------------------------
267 
269 
271  {
272  public:
277  , m_print_time()
278  {
279  }
280 
281  void update(uint64_t height, bool force = false)
282  {
283  auto current_time = std::chrono::system_clock::now();
284  const auto node_update_threshold = std::chrono::seconds(DIFFICULTY_TARGET_V1 / 2); // use min of V1/V2
285  if (node_update_threshold < current_time - m_blockchain_height_update_time || m_blockchain_height <= height)
286  {
289  }
290 
291  if (std::chrono::milliseconds(20) < current_time - m_print_time || force)
292  {
293  std::cout << QT_TRANSLATE_NOOP("cryptonote::simple_wallet", "Height ") << height << " / " << m_blockchain_height << '\r' << std::flush;
294  m_print_time = current_time;
295  }
296  }
297 
298  private:
300  {
301  std::string err;
302  uint64_t blockchain_height = m_simple_wallet.get_daemon_blockchain_height(err);
303  if (err.empty())
304  {
305  m_blockchain_height = blockchain_height;
306  m_blockchain_height_update_time = std::chrono::system_clock::now();
307  }
308  else
309  {
310  LOG_ERROR("Failed to get current blockchain height: " << err);
311  }
312  }
313 
314  private:
317  std::chrono::system_clock::time_point m_blockchain_height_update_time;
318  std::chrono::system_clock::time_point m_print_time;
319  };
320 
321  private:
322  std::string m_wallet_file;
323  std::string m_generate_new;
327  std::string m_generate_from_keys;
329  std::string m_generate_from_json;
330  std::string m_mnemonic_language;
331  std::string m_import_path;
333 
334  epee::wipeable_string m_electrum_seed; // electrum-style seed parameter
335 
336  crypto::secret_key m_recovery_key; // recovery key (used as random for wallet gen)
337  bool m_restore_deterministic_wallet; // recover flag
338  bool m_restore_multisig_wallet; // recover flag
339  bool m_non_deterministic; // old 2-random generation
341  bool m_restoring; // are we restoring, by whatever method?
342  uint64_t m_restore_height; // optional
345 
346  epee::console_handlers_binder m_cmd_binder;
347 
348  std::unique_ptr<tools::wallet2> m_wallet;
350 
351  std::atomic<bool> m_idle_run;
352  boost::thread m_idle_thread;
353  boost::mutex m_idle_mutex;
354  boost::condition_variable m_idle_cond;
355 
356  std::atomic<bool> m_auto_refresh_enabled;
358  std::atomic<bool> m_in_manual_refresh;
360 
362  };
363 }
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:7041
bool show_blockchain_height(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4548
Definition: wallet2.h:428
bool sign_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6016
std::string m_import_path
Definition: simplewallet.h:331
static const char * tr(const char *str)
Definition: simplewallet.h:69
Definition: wallet2.h:422
bool show_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7902
bool show_incoming_transfers(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4382
bool get_tx_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6214
#define QT_TRANSLATE_NOOP(context, str)
Definition: i18n.h:31
bool set_default_priority(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1906
std::string m_generate_from_spend_key
Definition: simplewallet.h:326
bool m_restore_deterministic_wallet
Definition: simplewallet.h:337
bool set_ring(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1467
bool make_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:882
bool ask_wallet_create_if_needed()
Definition: simplewallet.cpp:2771
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:3590
bool check_reserve_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6569
bool set_min_output_value(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2093
bool set_subaddress_lookahead(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2224
std::unique_ptr< tools::wallet2 > m_wallet
Definition: simplewallet.h:348
bool import_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1118
bool get_description(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7574
bool set_segregation_height(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2239
bool save(const std::vector< std::string > &args)
Definition: simplewallet.cpp:3956
std::string m_generate_from_multisig_keys
Definition: simplewallet.h:328
Definition: cryptonote_basic.h:366
bool m_non_deterministic
Definition: simplewallet.h:339
bool address_book(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7426
bool start_mining(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4003
bool set_ask_password(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2013
std::string get_command_usage(const std::vector< std::string > &args)
Definition: simplewallet.cpp:569
uint64_t height
Definition: blockchain.cpp:89
bool spendkey(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:607
bool unblackball(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1738
std::string m_generate_new
Definition: simplewallet.h:323
bool set_store_tx_info(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1841
#define DIFFICULTY_TARGET_V1
Definition: cryptonote_config.h:80
bool export_key_images(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7717
bool set_unit(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2045
std::string m_generate_from_device
Definition: simplewallet.h:324
bool import_outputs(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7865
std::string get_mnemonic_language()
Gets the word seed language from the user.
Definition: simplewallet.cpp:3538
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:69
bool m_auto_refresh_refreshing
Definition: simplewallet.h:357
bool set_refresh_from_block_height(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2168
bool set_variable(const std::vector< std::string > &args)
Definition: simplewallet.cpp:2637
bool set_confirm_backlog(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2124
bool encrypted_seed(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:693
bool exchange_multisig_keys(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1012
bool wallet_info(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7616
bool process_command(const std::vector< std::string > &args)
Definition: simplewallet.cpp:8051
uint64_t m_restore_height
Definition: simplewallet.h:342
bool locked_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5156
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:4207
uint64_t m_blockchain_height
Definition: simplewallet.h:316
bool save_known_rings(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1795
bool seed_set_language(const std::vector< std::string > &args=std::vector< std::string >())
Sets seed language.
Definition: simplewallet.cpp:698
bool set_print_ring_members(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1828
bool m_use_english_language_names
Definition: simplewallet.h:344
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:7505
bool open_wallet(const boost::program_options::variables_map &vm)
Definition: simplewallet.cpp:3822
bool donate(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5815
bool accept_loaded_tx(const tools::wallet2::multisig_tx_set &txs)
Definition: simplewallet.cpp:1192
bool set_refresh_type(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1981
bool sweep_single(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5563
Definition: wallet2.h:85
bool set_confirm_missing_payment_id(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1998
bool stop_mining(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4062
bool set_min_output_count(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2075
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:224
bool unspent_outputs(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6850
bool close_wallet()
Definition: simplewallet.cpp:3923
uint64_t get_daemon_blockchain_height(std::string &err)
Definition: simplewallet.cpp:4539
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:4202
std::chrono::system_clock::time_point m_print_time
Definition: simplewallet.h:318
bool export_raw_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1339
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:4722
std::string m_wallet_file
Definition: simplewallet.h:322
bool export_outputs(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7826
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:4174
Definition: wallet2.h:339
bool hw_reconnect(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7801
bool transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5151
void update(uint64_t height, bool force=false)
Definition: simplewallet.h:281
bool sweep_unmixable(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5167
bool try_connect_to_daemon(bool silent=false, uint32_t *version=nullptr)
Definition: simplewallet.cpp:3509
bool status(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7591
simple_wallet()
Definition: simplewallet.cpp:2282
bool get_spend_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6425
bool print_ring(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1416
virtual boost::optional< epee::wipeable_string > on_get_password(const char *reason)
Definition: simplewallet.cpp:4224
bool finalize_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:960
boost::thread m_idle_thread
Definition: simplewallet.h:352
boost::condition_variable m_idle_cond
Definition: simplewallet.h:354
bool version(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1809
bool set_key_reuse_mitigation2(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2211
bool help(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2269
void print_accounts()
Definition: simplewallet.cpp:7220
bool set_merge_destinations(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2111
void wallet_idle_thread()
Definition: simplewallet.cpp:7001
bool blackball(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1649
bool seed(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:688
bool set_confirm_backlog_threshold(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2137
constexpr const char MONERO_DONATION_ADDR[]
Definition: simplewallet.h:55
bool rescan_spent(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4562
bool set_segregate_pre_fork_outputs(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2198
bool export_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1067
Definition: subaddress_index.h:38
bool init(const boost::program_options::variables_map &vm)
Definition: simplewallet.cpp:2892
virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx)
Definition: simplewallet.cpp:4220
bool m_restore_multisig_wallet
Definition: simplewallet.h:338
void update_blockchain_height()
Definition: simplewallet.h:299
bool m_restoring
Definition: simplewallet.h:341
bool print_seed(bool encrypted)
Definition: simplewallet.cpp:629
std::string m_subaddress_lookahead
Definition: simplewallet.h:332
refresh_progress_reporter_t m_refresh_progress_reporter
Definition: simplewallet.h:349
bool sweep_main(uint64_t below, bool locked, const std::vector< std::string > &args)
Definition: simplewallet.cpp:5273
bool get_tx_key(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6115
bool check_spend_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6474
bool set_log(const std::vector< std::string > &args)
Definition: simplewallet.cpp:2742
std::string m_generate_from_json
Definition: simplewallet.h:329
bool get_tx_note(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7533
bool show_balance(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:4370
std::atomic< bool > m_in_manual_refresh
Definition: simplewallet.h:358
Definition: wallet2.h:416
bool get_reserve_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6515
bool save_bc(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4147
std::atomic< bool > m_auto_refresh_enabled
Definition: simplewallet.h:356
bool sign_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1198
std::string get_prompt() const
Definition: simplewallet.cpp:7029
bool set_confirm_export_overwrite(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2155
bool show_payments(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4485
Definition: cryptonote_basic.h:400
bool m_do_not_relay
Definition: simplewallet.h:343
bool set_daemon(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4084
bool m_long_payment_id_support
Definition: simplewallet.h:361
std::chrono::system_clock::time_point m_blockchain_height_update_time
Definition: simplewallet.h:317
cryptonote::simple_wallet & m_simple_wallet
Definition: simplewallet.h:315
bool refresh_main(uint64_t start_height, bool reset=false, bool is_init=false)
Definition: simplewallet.cpp:4250
bool verify(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7679
bool blackballed(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1765
bool viewkey(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:590
std::string get_commands_str()
Definition: simplewallet.cpp:558
bool import_key_images(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7759
bool check_tx_proof(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6347
void stop()
Definition: simplewallet.cpp:7055
bool set_auto_low_priority(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2185
bool sweep_all(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5794
boost::optional< tools::password_container > get_and_verify_password() const
Definition: simplewallet.cpp:3576
bool print_ring_members(const std::vector< tools::wallet2::pending_tx > &ptx_vector, std::ostream &ostr)
Definition: simplewallet.cpp:4609
std::string m_generate_from_keys
Definition: simplewallet.h:327
bool rescan_blockchain(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6988
bool save_watch_only(const std::vector< std::string > &args)
Definition: simplewallet.cpp:3972
bool submit_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:1271
bool print_integrated_address(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7376
bool refresh(const std::vector< std::string > &args)
Definition: simplewallet.cpp:4324
bool set_tx_key(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6156
boost::mutex m_idle_mutex
Definition: simplewallet.h:353
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_walle...
Definition: simplewallet.cpp:8068
POD_CLASS hash
Definition: hash.h:49
std::string m_mnemonic_language
Definition: simplewallet.h:330
bool change_password(const std::vector< std::string > &args)
Definition: simplewallet.cpp:748
bool sweep_below(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5799
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:7066
bool submit_transfer(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6080
std::atomic< bool > m_idle_run
Definition: simplewallet.h:351
bool sign(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7642
bool check_tx_key(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6259
bool print_fee_info(const std::vector< std::string > &args)
Definition: simplewallet.cpp:791
bool set_default_ring_size(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1860
crypto::secret_key m_recovery_key
Definition: simplewallet.h:336
uint32_t m_current_subaddress_account
Definition: simplewallet.h:359
bool set_always_confirm_transfers(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1815
epee::console_handlers_binder m_cmd_binder
Definition: simplewallet.h:346
std::string m_generate_from_view_key
Definition: simplewallet.h:325
bool payment_id(const std::vector< std::string > &args)
Definition: simplewallet.cpp:776
bool handle_command_line(const boost::program_options::variables_map &vm)
Definition: simplewallet.cpp:3476
bool set_description(const std::vector< std::string > &args)
Definition: simplewallet.cpp:7558
bool deinit()
Definition: simplewallet.cpp:3468
bool show_transfers(const std::vector< std::string > &args)
Definition: simplewallet.cpp:6656
epee::wipeable_string m_electrum_seed
Definition: simplewallet.h:334
bool locked_sweep_all(const std::vector< std::string > &args)
Definition: simplewallet.cpp:5161
Definition: cryptonote_basic.h:182
bool print_address(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:7276
void interrupt()
Definition: simplewallet.cpp:8056
bool m_allow_mismatched_daemon_version
Definition: simplewallet.h:340
bool set_auto_refresh(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:1962
virtual void on_new_block(uint64_t height, const cryptonote::block &block)
Definition: simplewallet.cpp:4168
bool set_ignore_fractional_outputs(const std::vector< std::string > &args=std::vector< std::string >())
Definition: simplewallet.cpp:2256
refresh_progress_reporter_t(cryptonote::simple_wallet &simple_wallet)
Definition: simplewallet.h:273
bool prepare_multisig(const std::vector< std::string > &args)
Definition: simplewallet.cpp:849
bool show_balance_unlocked(bool detailed=false)
Definition: simplewallet.cpp:4340