Electroneum
wallet2.h
Go to the documentation of this file.
1 // Copyrights(c) 2017-2021, The Electroneum Project
2 // Copyrights(c) 2014-2019, The Monero Project
3 //
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without modification, are
7 // permitted provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code must retain the above copyright notice, this list of
10 // conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
13 // of conditions and the following disclaimer in the documentation and/or other
14 // materials provided with the distribution.
15 //
16 // 3. Neither the name of the copyright holder nor the names of its contributors may be
17 // used to endorse or promote products derived from this software without specific
18 // prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31 
32 #pragma once
33 
34 #include <memory>
35 
36 #include <boost/program_options/options_description.hpp>
37 #include <boost/program_options/variables_map.hpp>
38 #include <boost/serialization/unordered_map.hpp>
39 
40 #if BOOST_VERSION >= 107400
41  #include <boost/serialization/library_version_type.hpp>
42 #endif
43 #include <boost/serialization/list.hpp>
44 #include <boost/serialization/vector.hpp>
45 #include <boost/serialization/deque.hpp>
46 #include <boost/thread/lock_guard.hpp>
47 #include <atomic>
48 #include <random>
49 #include<utility>
50 
51 #include "include_base_utils.h"
55 #include "net/http_client.h"
61 #include "common/util.h"
62 #include "crypto/chacha.h"
63 #include "crypto/hash.h"
64 #include "ringct/rctTypes.h"
65 #include "ringct/rctOps.h"
67 #include "serialization/pair.h"
68 
69 #include "wallet_errors.h"
70 #include "common/password.h"
71 #include "node_rpc_proxy.h"
72 #include "message_store.h"
73 #include "wallet_light_rpc.h"
74 
75 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY
76 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "wallet.wallet2"
77 
78 class Serialization_portability_wallet_Test;
80 
81 namespace tools
82 {
83  class ringdb;
84  class wallet2;
85  class Notify;
86 
88  {
89  public:
90  uint64_t pick();
91  gamma_picker(const std::vector<uint64_t> &rct_offsets);
92  gamma_picker(const std::vector<uint64_t> &rct_offsets, double shape, double scale);
93 
94  private:
95  struct gamma_engine
96  {
97  typedef uint64_t result_type;
98  static constexpr result_type min() { return 0; }
99  static constexpr result_type max() { return std::numeric_limits<result_type>::max(); }
100  result_type operator()() { return crypto::rand<result_type>(); }
101  } engine;
102 
103 private:
104  std::gamma_distribution<double> gamma;
105  const std::vector<uint64_t> &rct_offsets;
106  const uint64_t *begin, *end;
107  uint64_t num_rct_outputs;
108  double average_output_time;
109  };
110 
112  {
113  public:
114  wallet_keys_unlocker(wallet2 &w, const boost::optional<tools::password_container> &password);
115  wallet_keys_unlocker(wallet2 &w, bool locked, const epee::wipeable_string &password);
117  private:
118  wallet2 &w;
119  bool locked;
120  crypto::chacha_key key;
121  };
122 
124  {
125  public:
126  // Full wallet callbacks
127  virtual void on_new_block(uint64_t height, const cryptonote::block& block) {}
128  virtual void on_etn_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, const cryptonote::subaddress_index& subaddr_index, uint64_t unlock_time) {}
129  virtual void on_unconfirmed_etn_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t amount, const cryptonote::subaddress_index& subaddr_index) {}
130  virtual void on_etn_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) {}
131  virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction& tx) {}
132  virtual boost::optional<epee::wipeable_string> on_get_password(const char *reason) { return boost::none; }
133  // Light wallet callbacks
134  virtual void on_lw_new_block(uint64_t height) {}
135  virtual void on_lw_etn_received(uint64_t height, const crypto::hash &txid, uint64_t amount) {}
137  virtual void on_lw_etn_spent(uint64_t height, const crypto::hash &txid, uint64_t amount) {}
138  // Device callbacks
139  virtual void on_device_button_request(uint64_t code) {}
140  virtual void on_device_button_pressed() {}
141  virtual boost::optional<epee::wipeable_string> on_device_pin_request() { return boost::none; }
142  virtual boost::optional<epee::wipeable_string> on_device_passphrase_request(bool on_device) { return boost::none; }
143  virtual void on_device_progress(const hw::device_progress& event) {};
144  // Common callbacks
145  virtual void on_pool_tx_removed(const crypto::hash &txid) {}
146  virtual ~i_wallet2_callback() {}
147  };
148 
150  {
151  public:
152  wallet_device_callback(wallet2 * wallet): wallet(wallet) {};
153  void on_button_request(uint64_t code=0) override;
154  void on_button_pressed() override;
155  boost::optional<epee::wipeable_string> on_pin_request() override;
156  boost::optional<epee::wipeable_string> on_passphrase_request(bool on_device) override;
157  void on_progress(const hw::device_progress& event) override;
158  private:
159  wallet2 * wallet;
160  };
161 
163  {
167 
168  tx_dust_policy(uint64_t a_dust_threshold = 0, bool an_add_to_fee = true, cryptonote::account_public_address an_addr_for_dust = cryptonote::account_public_address())
169  : dust_threshold(a_dust_threshold)
170  , add_to_fee(an_add_to_fee)
171  , addr_for_dust(an_addr_for_dust)
172  {
173  }
174  };
175 
176  class hashchain
177  {
178  public:
179  hashchain(): m_genesis(crypto::null_hash), m_offset(0) {}
180 
181  size_t size() const { return m_blockchain.size() + m_offset; }
182  size_t offset() const { return m_offset; }
183  const crypto::hash &genesis() const { return m_genesis; }
184  void push_back(const crypto::hash &hash) { if (m_offset == 0 && m_blockchain.empty()) m_genesis = hash; m_blockchain.push_back(hash); }
185  bool is_in_bounds(size_t idx) const { return idx >= m_offset && idx < size(); }
186  const crypto::hash &operator[](size_t idx) const { return m_blockchain[idx - m_offset]; }
187  crypto::hash &operator[](size_t idx) { return m_blockchain[idx - m_offset]; }
188  void crop(size_t height) { m_blockchain.resize(height - m_offset); }
189  void clear() { m_offset = 0; m_blockchain.clear(); }
190  bool empty() const { return m_blockchain.empty() && m_offset == 0; }
191  void trim(size_t height) { while (height > m_offset && m_blockchain.size() > 1) { m_blockchain.pop_front(); ++m_offset; } m_blockchain.shrink_to_fit(); }
192  void refill(const crypto::hash &hash) { m_blockchain.push_back(hash); --m_offset; }
193 
194  template <class t_archive>
195  inline void serialize(t_archive &a, const unsigned int ver)
196  {
197  a & m_offset;
198  a & m_genesis;
199  a & m_blockchain;
200  }
201 
202  private:
203  size_t m_offset;
204  crypto::hash m_genesis;
205  std::deque<crypto::hash> m_blockchain;
206  };
207 
208  class wallet_keys_unlocker;
209  class wallet2
210  {
211  friend class ::Serialization_portability_wallet_Test;
212  friend class ::wallet_accessor_test;
213  friend class wallet_keys_unlocker;
215  public:
216  static constexpr const std::chrono::seconds rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30);
217 
218  enum RefreshType {
223  };
224 
229  };
230 
235  };
236 
237  static const char* tr(const char* str);
238 
239  static bool has_testnet_option(const boost::program_options::variables_map& vm);
240  static bool has_stagenet_option(const boost::program_options::variables_map& vm);
241  static std::string device_name_option(const boost::program_options::variables_map& vm);
242  static std::string device_derivation_path_option(const boost::program_options::variables_map &vm);
243  static void init_options(boost::program_options::options_description& desc_params);
244 
246  static std::pair<std::unique_ptr<wallet2>, password_container> make_from_json(const boost::program_options::variables_map& vm, bool unattended, const std::string& json_file, const std::function<boost::optional<password_container>(const char *, bool)> &password_prompter);
247 
249  static std::pair<std::unique_ptr<wallet2>, password_container>
250  make_from_file(const boost::program_options::variables_map& vm, bool unattended, const std::string& wallet_file, const std::function<boost::optional<password_container>(const char *, bool)> &password_prompter);
251 
253  static std::pair<std::unique_ptr<wallet2>, password_container> make_new(const boost::program_options::variables_map& vm, bool unattended, const std::function<boost::optional<password_container>(const char *, bool)> &password_prompter);
254 
256  static std::unique_ptr<wallet2> make_dummy(const boost::program_options::variables_map& vm, bool unattended, const std::function<boost::optional<password_container>(const char *, bool)> &password_prompter);
257 
258  static bool verify_password(const std::string& keys_file_name, const epee::wipeable_string& password, bool no_spend_key, hw::device &hwdev, uint64_t kdf_rounds);
259  static bool query_device(hw::device::device_type& device_type, const std::string& keys_file_name, const epee::wipeable_string& password, uint64_t kdf_rounds = 1);
260 
261  wallet2(cryptonote::network_type nettype = cryptonote::MAINNET, uint64_t kdf_rounds = 1, bool unattended = false);
262  ~wallet2();
263 
265  {
266  struct LR
267  {
270 
272  FIELD(m_L)
273  FIELD(m_R)
274  END_SERIALIZE()
275  };
276 
278  std::vector<LR> m_LR;
279  std::vector<crypto::key_image> m_partial_key_images; // one per key the participant has
280 
282  FIELD(m_signer)
283  FIELD(m_LR)
285  END_SERIALIZE()
286  };
287 
289  {
295  bool error;
296  boost::optional<cryptonote::subaddress_receive_info> received;
297 
298  tx_scan_info_t(): amount(0), etn_transfered(0), error(true) {}
299  };
300 
301  struct transfer_details // THESE ARE PER OUTPUT AND NOT PER TX
302  {
303  uint64_t m_block_height; // can be used to distinguish between out versions (txout_to_key & txout_to_key_public) rather than adding a new field
305  crypto::hash m_txid; // this is to be used in combination with m_internal_output_index for the chainstate indexes used in processing new transctions
306  size_t m_internal_output_index; //this is equivalent the the relative output index in the chainstate index
308  bool m_spent;
309  bool m_frozen;
311  crypto::key_image m_key_image; //TODO: key_image stored twice :(
314  bool m_rct;
316  bool m_key_image_request; // view wallets: we want to request it; cold wallets: it was requested
317  size_t m_pk_index;
320  std::vector<rct::key> m_multisig_k;
321  std::vector<multisig_info> m_multisig_info; // one per other participant
322  std::vector<std::pair<uint64_t, crypto::hash>> m_uses;
323 
324  bool is_rct() const { return m_rct; }
325  uint64_t amount() const { return m_amount; }
326  const crypto::public_key &get_public_key() const { return boost::get<const cryptonote::txout_to_key>(m_tx.vout[m_internal_output_index].target).key; }
327  const std::pair<crypto::hash, size_t> get_chainstate_index() const { return std::make_pair(m_txid, m_internal_output_index); }
328 
330  FIELD(m_block_height)
331  FIELD(m_tx)
332  FIELD(m_txid)
333  FIELD(m_internal_output_index)
334  FIELD(m_global_output_index)
335  FIELD(m_spent)
336  FIELD(m_frozen)
337  FIELD(m_spent_height)
338  FIELD(m_key_image)
339  FIELD(m_mask)
340  FIELD(m_amount)
341  FIELD(m_rct)
342  FIELD(m_key_image_known)
343  FIELD(m_key_image_request)
344  FIELD(m_pk_index)
345  FIELD(m_subaddr_index)
346  FIELD(m_key_image_partial)
347  FIELD(m_multisig_k)
348  FIELD(m_multisig_info)
349  FIELD(m_uses)
350  END_SERIALIZE()
351  };
352 
354  {
363  };
364 
366  {
367  bool m_mempool;
369  };
370 
372  {
376  };
377 
379  {
384  time_t m_sent_time;
385  std::vector<cryptonote::tx_destination_entry> m_dests;
387  enum { pending, pending_not_in_pool, failed } m_state;
389  uint32_t m_subaddr_account; // subaddress account of your wallet to be used in this transfer
390  std::set<uint32_t> m_subaddr_indices; // set of address indices used as inputs in this transfer
391  std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> m_rings; // relative
392  };
393 
395  {
400  std::vector<cryptonote::tx_destination_entry> m_dests;
404  uint32_t m_subaddr_account; // subaddress account of your wallet to be used in this transfer
405  std::set<uint32_t> m_subaddr_indices; // set of address indices used as inputs in this transfer
406  std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> m_rings; // relative
408 
409  confirmed_transfer_details(): m_amount_in(0), m_amount_out(0), m_change((uint64_t)-1), m_block_height(0), m_payment_id(crypto::null_hash), m_timestamp(0), m_unlock_time(0), m_subaddr_account((uint32_t)-1), m_is_migration(false) {}
411  m_amount_in(utd.m_amount_in), m_amount_out(utd.m_amount_out), m_change(utd.m_change), m_block_height(height), m_dests(utd.m_dests), m_payment_id(utd.m_payment_id), m_timestamp(utd.m_timestamp), m_unlock_time(utd.m_tx.unlock_time), m_subaddr_account(utd.m_subaddr_account), m_subaddr_indices(utd.m_subaddr_indices), m_rings(utd.m_rings), m_is_migration(utd.m_tx.version == 2) {}
412  };
413 
415  {
416  std::vector<cryptonote::tx_source_entry> sources;
418  std::vector<cryptonote::tx_destination_entry> splitted_dsts; // split, includes change
419  std::vector<size_t> selected_transfers;
420  std::vector<uint8_t> extra;
422  bool use_rct;
424  std::vector<cryptonote::tx_destination_entry> dests; // original setup, does not include change
425  uint32_t subaddr_account; // subaddress account of your wallet to be used in this transfer
426  std::set<uint32_t> subaddr_indices; // set of address indices used as inputs in this transfer
427 
429  FIELD(sources)
430  FIELD(change_dts)
431  FIELD(splitted_dsts)
432  FIELD(selected_transfers)
433  FIELD(extra)
434  FIELD(unlock_time)
435  FIELD(use_rct)
436  FIELD(rct_config)
437  FIELD(dests)
438  FIELD(subaddr_account)
439  FIELD(subaddr_indices)
440  END_SERIALIZE()
441  };
442 
443  typedef std::vector<transfer_details> transfer_container;
444  typedef std::unordered_multimap<crypto::hash, payment_details> payment_container;
445 
447  {
449  std::unordered_set<crypto::public_key> ignore;
450  std::unordered_set<rct::key> used_L;
451  std::unordered_set<crypto::public_key> signing_keys;
453  };
454 
455  // The convention for destinations is:
456  // dests does not include change
457  // splitted_dsts (in construction_data) does
458  struct pending_tx
459  {
464  std::vector<size_t> selected_transfers;
467  std::vector<crypto::secret_key> additional_tx_keys;
468  std::vector<cryptonote::tx_destination_entry> dests;
469  std::vector<multisig_sig> multisig_sigs;
470 
472 
474  FIELD(tx)
475  FIELD(dust)
476  FIELD(fee)
477  FIELD(dust_added_to_fee)
478  FIELD(change_dts)
479  FIELD(selected_transfers)
480  FIELD(key_images)
481  FIELD(tx_key)
482  FIELD(additional_tx_keys)
483  FIELD(dests)
484  FIELD(construction_data)
485  FIELD(multisig_sigs)
486  END_SERIALIZE()
487  };
488 
489  // The term "Unsigned tx" is not really a tx since it's not signed yet.
490  // It doesnt have tx hash, key and the integrated address is not separated into addr + payment id.
492  {
493  std::vector<tx_construction_data> txes;
494  std::pair<size_t, wallet2::transfer_container> transfers;
495  };
496 
498  {
499  std::vector<pending_tx> ptx;
500  std::vector<crypto::key_image> key_images;
501  std::unordered_map<crypto::public_key, crypto::key_image> tx_key_images;
502  };
503 
505  {
506  std::vector<pending_tx> m_ptx;
507  std::unordered_set<crypto::public_key> m_signers;
508 
510  FIELD(m_ptx)
511  FIELD(m_signers)
512  END_SERIALIZE()
513  };
514 
516  {
517  crypto::chacha_iv iv;
519 
521  FIELD(iv)
522  FIELD(account_data)
523  END_SERIALIZE()
524  };
525 
527  {
528  crypto::chacha_iv iv;
530 
532  FIELD(iv)
533  FIELD(cache_data)
534  END_SERIALIZE()
535  };
536 
537  // GUI Address book
539  {
544  };
545 
547  {
554  };
555 
556  typedef std::tuple<uint64_t, crypto::public_key, rct::key> get_outs_entry;
557 
559  {
562  std::vector<cryptonote::transaction> txes;
564  bool error;
565  };
566 
567  struct is_out_data //todo: refactor for per version structures
568  {
569  crypto::public_key pkey; //transaction public key R
570  crypto::key_derivation derivation; // D-H shared secret aR
571  std::vector<boost::optional<cryptonote::subaddress_receive_info>> received;
572  };
573 
574  // we have none(v2+), one, or many transaction private keys
575  // tx cache_data is a one-per-tx structure and the vectors below hold all
576  // the outputs for each transaction private key or all of the new public outs
577  // but note that a single is_out_data can hold many outputs (received field)
578  // eg: primary holds one is_out_data with multiple received outs inside the received field
579  // for a miner tx, or tx.vout.size() for a regular tx.
581  {
582  // V1 ONLY
583  std::vector<is_out_data> primary;
584  std::vector<is_out_data> additional;
585 
586  // ALL VERSIONS
587  std::vector<cryptonote::tx_extra_field> tx_extra_fields;
588 
589  // V2+ ONLY
590  std::vector<is_out_data> public_outs;
591 
592  bool empty() const { return tx_extra_fields.empty() && primary.empty() && additional.empty() && public_outs.empty(); }
593  bool public_only() const { return !public_outs.empty() && primary.empty() && additional.empty(); }
594  };
595 
603  void generate(const std::string& wallet_, const epee::wipeable_string& password,
604  const epee::wipeable_string& multisig_data, bool create_address_file = false);
605 
616  crypto::secret_key generate(const std::string& wallet, const epee::wipeable_string& password,
617  const crypto::secret_key& recovery_param = crypto::secret_key(), bool recover = false,
618  bool two_random = false, bool create_address_file = false);
628  void generate(const std::string& wallet, const epee::wipeable_string& password,
629  const cryptonote::account_public_address &account_public_address,
630  const crypto::secret_key& spendkey, const crypto::secret_key& viewkey, bool create_address_file = false);
639  void generate(const std::string& wallet, const epee::wipeable_string& password,
640  const cryptonote::account_public_address &account_public_address,
641  const crypto::secret_key& viewkey = crypto::secret_key(), bool create_address_file = false);
649  void restore(const std::string& wallet_, const epee::wipeable_string& password, const std::string &device_name, bool create_address_file = false);
650 
657  const std::vector<std::string> &info,
665  const std::vector<crypto::secret_key> &view_keys,
666  const std::vector<crypto::public_key> &spend_keys,
669  const std::vector<std::string> &info);
674  std::unordered_set<crypto::public_key> pkeys,
675  std::vector<crypto::public_key> signers);
679  bool finalize_multisig(const epee::wipeable_string &password, const std::vector<std::string> &info);
683  bool finalize_multisig(const epee::wipeable_string &password, const std::unordered_set<crypto::public_key> &pkeys, std::vector<crypto::public_key> signers);
691  static bool verify_multisig_info(const std::string &data, crypto::secret_key &skey, crypto::public_key &pkey);
695  static bool verify_extra_multisig_info(const std::string &data, std::unordered_set<crypto::public_key> &pkeys, crypto::public_key &signer);
705  size_t import_multisig(std::vector<cryptonote::blobdata> info);
711  void rewrite(const std::string& wallet_name, const epee::wipeable_string& password);
712  void write_watch_only_wallet(const std::string& wallet_name, const epee::wipeable_string& password, std::string &new_keys_filename);
713  void load(const std::string& wallet, const epee::wipeable_string& password);
714  void store();
720  void store_to(const std::string &path, const epee::wipeable_string &password);
721 
722  std::string path() const;
723 
727  bool verify_password(const epee::wipeable_string& password);
728  cryptonote::account_base& get_account(){return m_account;}
729  const cryptonote::account_base& get_account()const{return m_account;}
730 
731  void encrypt_keys(const crypto::chacha_key &key);
732  void encrypt_keys(const epee::wipeable_string &password);
733  void decrypt_keys(const crypto::chacha_key &key);
734  void decrypt_keys(const epee::wipeable_string &password);
735 
736  void set_refresh_from_block_height(uint64_t height) {m_refresh_from_block_height = height;}
737  uint64_t get_refresh_from_block_height() const {return m_refresh_from_block_height;}
738 
739  void explicit_refresh_from_block_height(bool expl) {m_explicit_refresh_from_block_height = expl;}
740  bool explicit_refresh_from_block_height() const {return m_explicit_refresh_from_block_height;}
741 
742  bool deinit();
743  bool init(std::string daemon_address = "http://localhost:8080",
744  boost::optional<epee::net_utils::http::login> daemon_login = boost::none,
745  boost::asio::ip::tcp::endpoint proxy = {},
746  uint64_t upper_transaction_weight_limit = 0,
747  bool trusted_daemon = true,
749  std::string blockchain_db_path = "");
750  bool set_daemon(std::string daemon_address = "http://localhost:8080",
751  boost::optional<epee::net_utils::http::login> daemon_login = boost::none, bool trusted_daemon = true,
753 
754  void stop() { m_run.store(false, std::memory_order_relaxed); m_message_store.stop(); }
755 
756  i_wallet2_callback* callback() const { return m_callback; }
757  void callback(i_wallet2_callback* callback) { m_callback = callback; }
758 
759  bool is_trusted_daemon() const { return m_trusted_daemon; }
760  void set_trusted_daemon(bool trusted) { m_trusted_daemon = trusted; }
761 
765  bool is_deterministic() const;
766  bool get_seed(epee::wipeable_string& electrum_words, const epee::wipeable_string &passphrase = epee::wipeable_string()) const;
767 
771  bool light_wallet() const { return m_light_wallet; }
772  void set_light_wallet(bool light_wallet) { m_light_wallet = light_wallet; }
773  uint64_t get_light_wallet_scanned_block_height() const { return m_light_wallet_scanned_block_height; }
774  uint64_t get_light_wallet_blockchain_height() const { return m_light_wallet_blockchain_height; }
775 
779  const std::string &get_seed_language() const;
783  void set_seed_language(const std::string &language);
784 
785  // Subaddress scheme
788  boost::optional<cryptonote::subaddress_index> get_subaddress_index(const cryptonote::account_public_address& address) const;
790  std::vector<crypto::public_key> get_subaddress_spend_public_keys(uint32_t account, uint32_t begin, uint32_t end) const;
794  void add_subaddress_account(const std::string& label, const bool update_account_tags = true);
795  size_t get_num_subaddress_accounts() const { return m_subaddress_labels.size(); } // number of accounts in wallet
796  size_t get_num_subaddresses(uint32_t index_major) const { return index_major < m_subaddress_labels.size() ? m_subaddress_labels[index_major].size() : 0; } // number of subaddresses in a particular account
797  void add_subaddress(uint32_t index_major, const std::string& label); // throws when index is out of bound
798  void expand_subaddresses(const cryptonote::subaddress_index& index, const bool udpate_account_tags = true);
800  void set_subaddress_label(const cryptonote::subaddress_index &index, const std::string &label);
801  void set_subaddress_lookahead(size_t major, size_t minor);
802  std::pair<size_t, size_t> get_subaddress_lookahead() const { return {m_subaddress_lookahead_major, m_subaddress_lookahead_minor}; }
803 
804  void account_major_offset(uint32_t offset) {m_account_major_offset = offset;}
805  uint32_t account_major_offset() const {return m_account_major_offset;}
809  bool is_deprecated() const;
810  void refresh(bool trusted_daemon);
811  void refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched);
812  void refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched, bool& received_etn, bool check_pool = true);
813  bool refresh(bool trusted_daemon, uint64_t & blocks_fetched, bool& received_etn, bool& ok);
814 
815  void set_refresh_type(RefreshType refresh_type) { m_refresh_type = refresh_type; }
816  RefreshType get_refresh_type() const { return m_refresh_type; }
817 
818  cryptonote::network_type nettype() const { return m_nettype; }
819  bool watch_only() const { return m_watch_only; }
820  bool multisig(bool *ready = NULL, uint32_t *threshold = NULL, uint32_t *total = NULL) const;
821  bool has_multisig_partial_key_images() const;
822  bool has_unknown_key_images() const;
823  bool get_multisig_seed(epee::wipeable_string& seed, const epee::wipeable_string &passphrase = std::string(), bool raw = true) const;
824  bool key_on_device() const { return get_device_type() != hw::device::device_type::SOFTWARE; }
825  hw::device::device_type get_device_type() const { return m_key_device_type; }
826  bool reconnect_device();
827 
828  // locked & unlocked balance of given or current subaddress account
829  uint64_t balance(uint32_t subaddr_index_major, bool public_blockchain) const;
830  uint64_t unlocked_balance(uint32_t subaddr_index_major, bool public_blockchain, uint64_t *blocks_to_unlock = NULL) const;
831  // total balance (both locked & unlocked) per subaddress of given or current subaddress account
832  // returns map of <minor index for account : amount>
833  std::map<uint32_t, uint64_t> balance_per_subaddress(uint32_t subaddr_index_major, bool public_blockchain = false) const;
834  // This is a map of : <minor index : < total amount, time entire balance at the minor index is unlocked>
835  // where total amount covers all locked & unlocked balances
836  std::map<uint32_t, std::pair<uint64_t, uint64_t>> unlocked_balance_per_subaddress(uint32_t subaddr_index_major, bool public_blockchain = false) const;
837  uint64_t balance_all(bool public_blockchain) const;
838  uint64_t unlocked_balance_all(bool public_blockchain, uint64_t *blocks_to_unlock = NULL) const;
839  template<typename T>
840  void transfer_selected(const std::vector<cryptonote::tx_destination_entry>& dsts, const std::vector<size_t>& selected_transfers, size_t fake_outputs_count,
841  std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
842  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);
843  void commit_tx(pending_tx& ptx_vector);
844  void commit_tx(std::vector<pending_tx>& ptx_vector);
845  bool save_tx(const std::vector<pending_tx>& ptx_vector, const std::string &filename) const;
846  std::string dump_tx_to_str(const std::vector<pending_tx> &ptx_vector) const;
847  std::string save_multisig_tx(multisig_tx_set txs);
848  bool save_multisig_tx(const multisig_tx_set &txs, const std::string &filename);
849  std::string save_multisig_tx(const std::vector<pending_tx>& ptx_vector);
850  bool save_multisig_tx(const std::vector<pending_tx>& ptx_vector, const std::string &filename);
851  multisig_tx_set make_multisig_tx_set(const std::vector<pending_tx>& ptx_vector) const;
852  // load unsigned tx from file and sign it. Takes confirmation callback as argument. Used by the cli wallet
853  bool sign_tx(const std::string &unsigned_filename, const std::string &signed_filename, std::vector<wallet2::pending_tx> &ptx, std::function<bool(const unsigned_tx_set&)> accept_func = NULL, bool export_raw = false);
854  // sign unsigned tx. Takes unsigned_tx_set as argument. Used by GUI
855  bool sign_tx(unsigned_tx_set &exported_txs, const std::string &signed_filename, std::vector<wallet2::pending_tx> &ptx, bool export_raw = false);
856  bool sign_tx(unsigned_tx_set &exported_txs, std::vector<wallet2::pending_tx> &ptx, signed_tx_set &signed_txs);
857  std::string sign_tx_dump_to_str(unsigned_tx_set &exported_txs, std::vector<wallet2::pending_tx> &ptx, signed_tx_set &signed_txes);
858  // load unsigned_tx_set from file.
859  bool load_unsigned_tx(const std::string &unsigned_filename, unsigned_tx_set &exported_txs) const;
860  bool parse_unsigned_tx_from_str(const std::string &unsigned_tx_st, unsigned_tx_set &exported_txs) const;
861  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);
862  bool parse_tx_from_str(const std::string &signed_tx_st, std::vector<tools::wallet2::pending_tx> &ptx, std::function<bool(const signed_tx_set &)> accept_func);
863  std::vector<wallet2::pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices); // pass subaddr_indices by value on purpose
864  std::vector<wallet2::pending_tx> create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const bool migrate = false);
865  std::vector<wallet2::pending_tx> create_transactions_single(const crypto::key_image &ki, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra);
866  std::vector<wallet2::pending_tx> create_transactions_from(const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, std::vector<size_t> unused_transfers_indices, std::vector<size_t> unused_dust_indices, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, const uint8_t tx_version);
867  bool sanity_check(const std::vector<wallet2::pending_tx> &ptx_vector, std::vector<cryptonote::tx_destination_entry> dsts) const;
868  void cold_tx_aux_import(const std::vector<pending_tx>& ptx, const std::vector<std::string>& tx_device_aux);
869  void cold_sign_tx(const std::vector<pending_tx>& ptx_vector, signed_tx_set &exported_txs, std::vector<cryptonote::address_parse_info> &dsts_info, std::vector<std::string> & tx_device_aux);
870  uint64_t cold_key_image_sync(uint64_t &spent, uint64_t &unspent);
871  bool parse_multisig_tx_from_str(std::string multisig_tx_st, multisig_tx_set &exported_txs) const;
872  bool load_multisig_tx(cryptonote::blobdata blob, multisig_tx_set &exported_txs, std::function<bool(const multisig_tx_set&)> accept_func = NULL);
873  bool load_multisig_tx_from_file(const std::string &filename, multisig_tx_set &exported_txs, std::function<bool(const multisig_tx_set&)> accept_func = NULL);
874  bool sign_multisig_tx_from_file(const std::string &filename, std::vector<crypto::hash> &txids, std::function<bool(const multisig_tx_set&)> accept_func);
875  bool sign_multisig_tx(multisig_tx_set &exported_txs, std::vector<crypto::hash> &txids);
876  bool sign_multisig_tx_to_file(multisig_tx_set &exported_txs, const std::string &filename, std::vector<crypto::hash> &txids);
877  std::vector<pending_tx> create_unmixable_sweep_transactions();
879  bool check_connection(uint32_t *version = NULL, bool *ssl = NULL, uint32_t timeout = 200000);
880  void get_transfers(wallet2::transfer_container& incoming_transfers) const;
881  void get_payments(const crypto::hash& payment_id, std::list<wallet2::payment_details>& payments, uint64_t min_height = 0, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
882  void get_payments(std::list<std::pair<crypto::hash,wallet2::payment_details>>& payments, uint64_t min_height, uint64_t max_height = (uint64_t)-1, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
883  void get_payments_out(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
884  uint64_t min_height, uint64_t max_height = (uint64_t)-1, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
885  void get_payments_out_migration(std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>>& confirmed_payments,
886  uint64_t min_height, uint64_t max_height = (uint64_t)-1, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
887  void get_unconfirmed_payments_out(std::list<std::pair<crypto::hash,wallet2::unconfirmed_transfer_details>>& unconfirmed_payments, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
888  void get_unconfirmed_payments(std::list<std::pair<crypto::hash,wallet2::pool_payment_details>>& unconfirmed_payments, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
889 
890  uint64_t get_blockchain_current_height() const { return m_light_wallet_blockchain_height ? m_light_wallet_blockchain_height : m_blockchain.size(); }
892  bool public_transactions_required() const { return nettype() == cryptonote::network_type::MAINNET ? get_blockchain_current_height() >= (1175315 - CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS) : get_blockchain_current_height() >= (1165235 - CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS);} // prepare v2 tx if the block height is one before the fork block (which contains v2+ tx only)
893  void rescan_spent();
894  void rescan_blockchain(bool hard, bool refresh = true, bool keep_key_images = false);
895  bool is_transfer_unlocked(const transfer_details& td) const;
896  bool is_transfer_unlocked(uint64_t unlock_time, uint64_t block_height) const;
897 
898  uint64_t get_last_block_reward() const { return m_last_block_reward; }
899  uint64_t get_device_last_key_image_sync() const { return m_device_last_key_image_sync; }
900 
901  template <class t_archive>
902  inline void serialize(t_archive &a, const unsigned int ver)
903  {
904  uint64_t dummy_refresh_height = 0; // moved to keys file
905  if(ver < 5)
906  return;
907  if (ver < 19)
908  {
909  std::vector<crypto::hash> blockchain;
910  a & blockchain;
911  for (const auto &b: blockchain)
912  {
913  m_blockchain.push_back(b);
914  }
915  }
916  else
917  {
918  a & m_blockchain;
919  }
920  a & m_transfers;
921  a & m_account_public_address;
922  a & m_key_images;
923  if(ver < 6)
924  return;
925  a & m_unconfirmed_txs;
926  if(ver < 7)
927  return;
928  a & m_payments;
929  if(ver < 8)
930  return;
931  a & m_tx_keys;
932  if(ver < 9)
933  return;
934  a & m_confirmed_txs;
935  if(ver < 11)
936  return;
937  a & dummy_refresh_height;
938  if(ver < 12)
939  return;
940  a & m_tx_notes;
941  if(ver < 13)
942  return;
943  if (ver < 17)
944  {
945  // we're loading an old version, where m_unconfirmed_payments was a std::map
946  std::unordered_map<crypto::hash, payment_details> m;
947  a & m;
948  for (std::unordered_map<crypto::hash, payment_details>::const_iterator i = m.begin(); i != m.end(); ++i)
949  m_unconfirmed_payments.insert(std::make_pair(i->first, pool_payment_details{i->second, false}));
950  }
951  if(ver < 14)
952  return;
953  if(ver < 15)
954  {
955  // we're loading an older wallet without a pubkey map, rebuild it
956  for (size_t i = 0; i < m_transfers.size(); ++i)
957  {
958  const transfer_details &td = m_transfers[i];
960  const cryptonote::txout_to_key &o = boost::get<const cryptonote::txout_to_key>(out.target);
961  m_pub_keys.emplace(o.key, i);
962  }
963  return;
964  }
965  a & m_pub_keys;
966  if(ver < 16)
967  return;
968  a & m_address_book;
969  if(ver < 17)
970  return;
971  if (ver < 22)
972  {
973  // we're loading an old version, where m_unconfirmed_payments payload was payment_details
974  std::unordered_multimap<crypto::hash, payment_details> m;
975  a & m;
976  for (const auto &i: m)
977  m_unconfirmed_payments.insert(std::make_pair(i.first, pool_payment_details{i.second, false}));
978  }
979  if(ver < 18)
980  return;
981  a & m_scanned_pool_txs[0];
982  a & m_scanned_pool_txs[1];
983  if (ver < 20)
984  return;
985  a & m_subaddresses;
986  std::unordered_map<cryptonote::subaddress_index, crypto::public_key> dummy_subaddresses_inv;
987  a & dummy_subaddresses_inv;
988  a & m_subaddress_labels;
989  a & m_additional_tx_keys;
990  if(ver < 21)
991  return;
992  a & m_attributes;
993  if(ver < 22)
994  return;
995  a & m_unconfirmed_payments;
996  if(ver < 23)
997  return;
998  a & m_account_tags;
999  if(ver < 24)
1000  return;
1001  a & m_ring_history_saved;
1002  if(ver < 25)
1003  return;
1004  a & m_last_block_reward;
1005  if(ver < 26)
1006  return;
1007  a & m_tx_device;
1008  if(ver < 27)
1009  return;
1010  a & m_device_last_key_image_sync;
1011  if(ver < 28)
1012  return;
1013  a & m_cold_key_images;
1014  if(ver < 29)
1015  return;
1016  a & m_chainstate_indexes;
1017  }
1018 
1025  static void wallet_exists(const std::string& file_path, bool& keys_file_exists, bool& wallet_file_exists);
1032  {
1033  char buffer[64];
1034  if (ts < 1234567890)
1035  return "<unknown>";
1036  time_t tt = ts;
1037  struct tm tm;
1038  #ifdef WIN32
1039  gmtime_s(&tm, &tt);
1040  #else
1041  gmtime_r(&tt, &tm);
1042  #endif
1043  uint64_t now = time(NULL);
1044  uint64_t diff = ts > now ? ts - now : now - ts;
1045  if (diff > 24*3600)
1046  strftime(buffer, sizeof(buffer), "%Y-%m-%d", &tm);
1047  else
1048  strftime(buffer, sizeof(buffer), "%I:%M:%S %p", &tm);
1049  return std::string(buffer);
1050 }
1051 //----------------------------------------------------------------------------------------------------
1052  static bool wallet_valid_path_format(const std::string& file_path);
1053  static bool parse_long_payment_id(const std::string& payment_id_str, crypto::hash& payment_id);
1054  static bool parse_short_payment_id(const std::string& payment_id_str, crypto::hash8& payment_id);
1055  static bool parse_payment_id(const std::string& payment_id_str, crypto::hash& payment_id);
1056 
1057  bool always_confirm_transfers() const { return m_always_confirm_transfers; }
1058  void always_confirm_transfers(bool always) { m_always_confirm_transfers = always; }
1059  bool print_ring_members() const { return m_print_ring_members; }
1060  void print_ring_members(bool value) { m_print_ring_members = value; }
1061  bool store_tx_info() const { return m_store_tx_info; }
1062  void store_tx_info(bool store) { m_store_tx_info = store; }
1063  uint32_t default_mixin() const { return m_default_mixin; }
1064  void default_mixin(uint32_t m) { m_default_mixin = m; }
1065  uint32_t get_default_priority() const { return m_default_priority; }
1066  void set_default_priority(uint32_t p) { m_default_priority = p; }
1067  bool auto_refresh() const { return m_auto_refresh; }
1068  void auto_refresh(bool r) { m_auto_refresh = r; }
1069  bool confirm_missing_payment_id() const { return m_confirm_missing_payment_id; }
1070  void confirm_missing_payment_id(bool always) { m_confirm_missing_payment_id = always; }
1071  AskPasswordType ask_password() const { return m_ask_password; }
1072  void ask_password(AskPasswordType ask) { m_ask_password = ask; }
1073  void set_min_output_count(uint32_t count) { m_min_output_count = count; }
1074  uint32_t get_min_output_count() const { return m_min_output_count; }
1075  void set_min_output_value(uint64_t value) { m_min_output_value = value; }
1076  uint64_t get_min_output_value() const { return m_min_output_value; }
1077  void merge_destinations(bool merge) { m_merge_destinations = merge; }
1078  bool merge_destinations() const { return m_merge_destinations; }
1079  bool confirm_backlog() const { return m_confirm_backlog; }
1080  void confirm_backlog(bool always) { m_confirm_backlog = always; }
1081  void set_confirm_backlog_threshold(uint32_t threshold) { m_confirm_backlog_threshold = threshold; };
1082  uint32_t get_confirm_backlog_threshold() const { return m_confirm_backlog_threshold; };
1083  bool confirm_export_overwrite() const { return m_confirm_export_overwrite; }
1084  void confirm_export_overwrite(bool always) { m_confirm_export_overwrite = always; }
1085  bool auto_low_priority() const { return m_auto_low_priority; }
1086  void auto_low_priority(bool value) { m_auto_low_priority = value; }
1087  bool segregate_pre_fork_outputs() const { return m_segregate_pre_fork_outputs; }
1088  void segregate_pre_fork_outputs(bool value) { m_segregate_pre_fork_outputs = value; }
1089  bool key_reuse_mitigation2() const { return m_key_reuse_mitigation2; }
1090  void key_reuse_mitigation2(bool value) { m_key_reuse_mitigation2 = value; }
1091  uint64_t segregation_height() const { return m_segregation_height; }
1092  void segregation_height(uint64_t height) { m_segregation_height = height; }
1093  bool ignore_fractional_outputs() const { return m_ignore_fractional_outputs; }
1094  void ignore_fractional_outputs(bool value) { m_ignore_fractional_outputs = value; }
1095  bool confirm_non_default_ring_size() const { return m_confirm_non_default_ring_size; }
1096  void confirm_non_default_ring_size(bool always) { m_confirm_non_default_ring_size = always; }
1097  bool track_uses() const { return m_track_uses; }
1098  void track_uses(bool value) { m_track_uses = value; }
1099  BackgroundMiningSetupType setup_background_mining() const { return m_setup_background_mining; }
1100  void setup_background_mining(BackgroundMiningSetupType value) { m_setup_background_mining = value; }
1101  const std::string & device_name() const { return m_device_name; }
1102  void device_name(const std::string & device_name) { m_device_name = device_name; }
1103  const std::string & device_derivation_path() const { return m_device_derivation_path; }
1105 
1106  bool get_tx_key_cached(const crypto::hash &txid, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys) const;
1107  void set_tx_key(const crypto::hash &txid, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys);
1108  bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys);
1109  void check_tx_key(const crypto::hash &txid, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, const cryptonote::account_public_address &address, uint64_t &received, bool &in_pool, uint64_t &confirmations);
1110  void check_tx_key_helper(const crypto::hash &txid, const crypto::key_derivation &derivation, const std::vector<crypto::key_derivation> &additional_derivations, const cryptonote::account_public_address &address, uint64_t &received, bool &in_pool, uint64_t &confirmations);
1111  void check_tx_key_helper(const cryptonote::transaction &tx, const crypto::key_derivation &derivation, const std::vector<crypto::key_derivation> &additional_derivations, const cryptonote::account_public_address &address, uint64_t &received) const;
1112  std::string get_tx_proof(const crypto::hash &txid, const cryptonote::account_public_address &address, bool is_subaddress, const std::string &message);
1113  std::string get_tx_proof(const cryptonote::transaction &tx, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, const cryptonote::account_public_address &address, bool is_subaddress, const std::string &message) const;
1114  bool check_tx_proof(const crypto::hash &txid, const cryptonote::account_public_address &address, bool is_subaddress, const std::string &message, const std::string &sig_str, uint64_t &received, bool &in_pool, uint64_t &confirmations);
1115  bool check_tx_proof(const cryptonote::transaction &tx, const cryptonote::account_public_address &address, bool is_subaddress, const std::string &message, const std::string &sig_str, uint64_t &received) const;
1116 
1118  bool check_spend_proof(const crypto::hash &txid, const std::string &message, const std::string &sig_str);
1119 
1127  std::string get_reserve_proof(const boost::optional<std::pair<uint32_t, uint64_t>> &account_minreserve, const std::string &message);
1138 
1142  std::vector<address_book_row> get_address_book() const { return m_address_book; }
1143  bool add_address_book_row(const cryptonote::account_public_address &address, const crypto::hash &payment_id, const std::string &description, bool is_subaddress);
1144  bool delete_address_book_row(std::size_t row_id);
1145 
1147  size_t get_num_transfer_details() const { return m_transfers.size(); }
1148  const transfer_details &get_transfer_details(size_t idx) const;
1149 
1150  void get_hard_fork_info(uint8_t version, uint64_t &earliest_height) const;
1151  bool use_fork_rules(uint8_t version, int64_t early_blocks = 0) const;
1152  int get_fee_algorithm() const;
1153 
1154  std::string get_wallet_file() const;
1155  std::string get_keys_file() const;
1157  const boost::optional<epee::net_utils::http::login>& get_daemon_login() const { return m_daemon_login; }
1165  std::vector<size_t> select_available_outputs_from_histogram(uint64_t count, bool atleast, bool unlocked, bool allow_rct);
1166  std::vector<size_t> select_available_outputs(const std::function<bool(const transfer_details &td)> &f) const;
1167  std::vector<size_t> select_available_unmixable_outputs();
1168  std::vector<size_t> select_available_mixable_outputs();
1169 
1170  size_t pop_best_value_from(const transfer_container &transfers, std::vector<size_t> &unused_dust_indices, const std::vector<size_t>& selected_transfers, bool smallest = false) const;
1171  size_t pop_best_value(std::vector<size_t> &unused_dust_indices, const std::vector<size_t>& selected_transfers, bool smallest = false) const;
1172 
1173  void set_tx_note(const crypto::hash &txid, const std::string &note);
1174  std::string get_tx_note(const crypto::hash &txid) const;
1175 
1176  void set_tx_device_aux(const crypto::hash &txid, const std::string &aux);
1177  std::string get_tx_device_aux(const crypto::hash &txid) const;
1178 
1179  void set_description(const std::string &description);
1180  std::string get_description() const;
1181 
1186  const std::pair<std::map<std::string, std::string>, std::vector<std::string>>& get_account_tags();
1192  void set_account_tag(const std::set<uint32_t> &account_indices, const std::string& tag);
1198  void set_account_tag_description(const std::string& tag, const std::string& description);
1199 
1200  std::string sign(const std::string &data) const;
1201  bool verify(const std::string &data, const cryptonote::account_public_address &address, const std::string &signature) const;
1202 
1217  bool verify_with_public_key(const std::string &data, const crypto::public_key &public_key, const std::string &signature) const;
1218 
1219  // Import/Export wallet data
1220  std::pair<size_t, std::vector<tools::wallet2::transfer_details>> export_outputs(bool all = false) const;
1221  std::string export_outputs_to_str(bool all = false) const;
1222  size_t import_outputs(const std::pair<size_t, std::vector<tools::wallet2::transfer_details>> &outputs);
1223  size_t import_outputs_from_str(const std::string &outputs_st);
1225  void import_payments(const payment_container &payments);
1226  void import_payments_out(const std::list<std::pair<crypto::hash,wallet2::confirmed_transfer_details>> &confirmed_payments);
1227  std::tuple<size_t, crypto::hash, std::vector<crypto::hash>> export_blockchain() const;
1228  void import_blockchain(const std::tuple<size_t, crypto::hash, std::vector<crypto::hash>> &bc);
1229  bool export_key_images(const std::string &filename) const;
1230  std::pair<size_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> export_key_images(bool all = false) const;
1231  uint64_t import_key_images(const std::vector<std::pair<crypto::key_image, crypto::signature>> &signed_key_images, size_t offset, uint64_t &spent, uint64_t &unspent, bool check_spent = true);
1232  uint64_t import_key_images(const std::string &filename, uint64_t &spent, uint64_t &unspent);
1233  bool import_key_images(std::vector<crypto::key_image> key_images, size_t offset=0, boost::optional<std::unordered_set<size_t>> selected_transfers=boost::none);
1234  bool import_key_images(signed_tx_set & signed_tx, size_t offset=0, bool only_selected_transfers=false);
1236 
1237  void update_pool_state(bool refreshed = false);
1238  void remove_obsolete_pool_txs(const std::vector<crypto::hash> &tx_hashes);
1239 
1240  std::string encrypt(const char *plaintext, size_t len, const crypto::secret_key &skey, bool authenticated = true) const;
1241  std::string encrypt(const epee::span<char> &span, const crypto::secret_key &skey, bool authenticated = true) const;
1242  std::string encrypt(const std::string &plaintext, const crypto::secret_key &skey, bool authenticated = true) const;
1243  std::string encrypt(const epee::wipeable_string &plaintext, const crypto::secret_key &skey, bool authenticated = true) const;
1244  std::string encrypt_with_view_secret_key(const std::string &plaintext, bool authenticated = true) const;
1245  template<typename T=std::string> T decrypt(const std::string &ciphertext, const crypto::secret_key &skey, bool authenticated = true) const;
1246  std::string decrypt_with_view_secret_key(const std::string &ciphertext, bool authenticated = true) const;
1247 
1248  std::string make_uri(const std::string &address, const std::string &payment_id, uint64_t amount, const std::string &tx_description, const std::string &recipient_name, std::string &error) const;
1249  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);
1250 
1251  uint64_t get_blockchain_height_by_date(uint16_t year, uint8_t month, uint8_t day); // 1<=month<=12, 1<=day<=31
1252 
1253  bool is_synced() const;
1254 
1255  std::vector<std::pair<uint64_t, uint64_t>> estimate_backlog(const std::vector<std::pair<double, double>> &fee_levels);
1256  std::vector<std::pair<uint64_t, uint64_t>> estimate_backlog(uint64_t min_tx_weight, uint64_t max_tx_weight, const std::vector<uint64_t> &fees);
1257 
1258  uint64_t get_fee_multiplier(uint32_t priority, int fee_algorithm = -1) const;
1259  uint64_t get_base_fee() const;
1261  uint64_t get_min_ring_size() const;
1262  uint64_t get_max_ring_size() const;
1263  uint64_t adjust_mixin(uint64_t mixin) const;
1264  uint32_t adjust_priority(uint32_t priority);
1265 
1266  bool is_unattended() const { return m_unattended; }
1267 
1268  // Light wallet specific functions
1269  // fetch unspent outs from lw node and store in m_transfers
1271  // fetch txs and store in m_payments
1273  // get_address_info
1275  // Login. new_address is true if address hasn't been used on lw node before.
1276  bool light_wallet_login(bool &new_address);
1277  // Send an import request to lw node. returns info about import fee, address and payment_id
1279  // get random outputs from light wallet server
1280  void light_wallet_get_outs(std::vector<std::vector<get_outs_entry>> &outs, const std::vector<size_t> &selected_transfers, size_t fake_outputs_count);
1281  // Parse rct string
1282  bool light_wallet_parse_rct_str(const std::string& rct_string, const crypto::public_key& tx_pub_key, uint64_t internal_output_index, rct::key& decrypted_mask, rct::key& rct_commit, bool decrypt) const;
1283  // check if key image is ours
1284  bool light_wallet_key_image_is_ours(const crypto::key_image& key_image, const crypto::public_key& tx_public_key, uint64_t out_index);
1285 
1286  /*
1287  * "attributes" are a mechanism to store an arbitrary number of string values
1288  * on the level of the wallet as a whole, identified by keys. Their introduction,
1289  * technically the unordered map m_attributes stored as part of a wallet file,
1290  * led to a new wallet file version, but now new singular pieces of info may be added
1291  * without the need for a new version.
1292  *
1293  * The first and so far only value stored as such an attribute is the description.
1294  * It's stored under the standard key ATTRIBUTE_DESCRIPTION (see method set_description).
1295  *
1296  * The mechanism is open to all clients and allows them to use it for storing basically any
1297  * single string values in a wallet. To avoid the problem that different clients possibly
1298  * overwrite or misunderstand each other's attributes, a two-part key scheme is
1299  * proposed: <client name>.<value name>
1300  */
1301  const char* const ATTRIBUTE_DESCRIPTION = "wallet2.description";
1302  void set_attribute(const std::string &key, const std::string &value);
1303  std::string get_attribute(const std::string &key) const;
1304 
1309 
1310  template<class t_request, class t_response>
1311  inline bool invoke_http_json(const boost::string_ref uri, const t_request& req, t_response& res, std::chrono::milliseconds timeout = std::chrono::seconds(15), const boost::string_ref http_method = "GET")
1312  {
1313  if (m_offline) return false;
1314  boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1315  return epee::net_utils::invoke_http_json(uri, req, res, m_http_client, timeout, http_method);
1316  }
1317  template<class t_request, class t_response>
1318  inline bool invoke_http_bin(const boost::string_ref uri, const t_request& req, t_response& res, std::chrono::milliseconds timeout = std::chrono::seconds(15), const boost::string_ref http_method = "GET")
1319  {
1320  if (m_offline) return false;
1321  boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1322  return epee::net_utils::invoke_http_bin(uri, req, res, m_http_client, timeout, http_method);
1323  }
1324  template<class t_request, class t_response>
1325  inline bool invoke_http_json_rpc(const boost::string_ref uri, const std::string& method_name, const t_request& req, t_response& res, std::chrono::milliseconds timeout = std::chrono::seconds(15), const boost::string_ref http_method = "GET", const std::string& req_id = "0")
1326  {
1327  if (m_offline) return false;
1328  boost::lock_guard<boost::recursive_mutex> lock(m_daemon_rpc_mutex);
1329  return epee::net_utils::invoke_http_json_rpc(uri, method_name, req, res, m_http_client, timeout, http_method, req_id);
1330  }
1331 
1332  bool set_ring_database(const std::string &filename);
1333  const std::string get_ring_database() const { return m_ring_database; }
1334  bool get_ring(const crypto::key_image &key_image, std::vector<uint64_t> &outs);
1335  bool get_rings(const crypto::hash &txid, std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> &outs);
1336  bool set_ring(const crypto::key_image &key_image, const std::vector<uint64_t> &outs, bool relative);
1337  bool unset_ring(const std::vector<crypto::key_image> &key_images);
1338  bool unset_ring(const crypto::hash &txid);
1339  bool find_and_save_rings(bool force = true);
1340 
1341  bool blackball_output(const std::pair<uint64_t, uint64_t> &output);
1342  bool set_blackballed_outputs(const std::vector<std::pair<uint64_t, uint64_t>> &outputs, bool add = false);
1343  bool unblackball_output(const std::pair<uint64_t, uint64_t> &output);
1344  bool is_output_blackballed(const std::pair<uint64_t, uint64_t> &output) const;
1345 
1346  void freeze(size_t idx);
1347  void thaw(size_t idx);
1348  bool frozen(size_t idx) const;
1349  void freeze(const crypto::key_image &ki);
1350  void thaw(const crypto::key_image &ki);
1351  bool frozen(const crypto::key_image &ki) const;
1352  bool frozen(const transfer_details &td) const;
1353 
1354  uint64_t get_bytes_sent() const;
1355  uint64_t get_bytes_received() const;
1357 
1358  // MMS -------------------------------------------------------------------------------------------------
1359  mms::message_store& get_message_store() { return m_message_store; };
1360  const mms::message_store& get_message_store() const { return m_message_store; };
1362 
1363  bool lock_keys_file();
1364  bool unlock_keys_file();
1365  bool is_keys_file_locked() const;
1366 
1367  void change_password(const std::string &filename, const epee::wipeable_string &original_password, const epee::wipeable_string &new_password);
1368 
1369  void set_tx_notify(const std::shared_ptr<tools::Notify> &notify) { m_tx_notify = notify; }
1370 
1371  bool is_tx_spendtime_unlocked(uint64_t unlock_time, uint64_t block_height) const;
1372  void hash_m_transfer(const transfer_details & transfer, crypto::hash &hash) const;
1373  uint64_t hash_m_transfers(int64_t transfer_height, crypto::hash &hash) const;
1374  void finish_rescan_bc_keep_key_images(uint64_t transfer_height, const crypto::hash &hash);
1375  void enable_dns(bool enable) { m_use_dns = enable; }
1376  void set_offline(bool offline = true);
1377 
1378  private:
1386  bool store_keys(const std::string& keys_file_name, const epee::wipeable_string& password, bool watch_only = false);
1392  bool load_keys(const std::string& keys_file_name, const epee::wipeable_string& password);
1393  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, bool double_spend_seen, bool nonexistent_utxo_seen, const tx_cache_data &tx_cache_data, std::pair<std::map<std::pair<uint64_t, uint64_t>, size_t>, std::map<std::pair<std::array<char, 32>, size_t>, size_t>> *output_tracker_cache = NULL);
1394  bool should_skip_block(const cryptonote::block &b, uint64_t height) const;
1395  void process_new_blockchain_entry(const cryptonote::block& b, const cryptonote::block_complete_entry& bche, const parsed_block &parsed_block, const crypto::hash& bl_id, uint64_t height, const std::vector<tx_cache_data> &tx_cache_data, size_t tx_cache_data_offset, std::pair<std::map<std::pair<uint64_t, uint64_t>, size_t>, std::map<std::pair<std::array<char, 32>, size_t>, size_t>> *output_tracker_cache = NULL);
1396  void detach_blockchain(uint64_t height, std::pair<std::map<std::pair<uint64_t, uint64_t>, size_t>, std::map<std::pair<std::array<char, 32>, size_t>, size_t>> *output_tracker_cache = NULL);
1397  void get_short_chain_history(std::list<crypto::hash>& ids, uint64_t granularity = 1) const;
1398  bool clear();
1399  void clear_soft(bool keep_key_images=false);
1400  void pull_blocks(uint64_t start_height, uint64_t& blocks_start_height, const std::list<crypto::hash> &short_chain_history, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> &o_indices);
1401  void pull_hashes(uint64_t start_height, uint64_t& blocks_start_height, const std::list<crypto::hash> &short_chain_history, std::vector<crypto::hash> &hashes);
1402  void fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history, bool force = false);
1403  void pull_and_parse_next_blocks(uint64_t start_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history, const std::vector<cryptonote::block_complete_entry> &prev_blocks, const std::vector<parsed_block> &prev_parsed_blocks, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<parsed_block> &parsed_blocks, bool &error);
1404  void process_parsed_blocks(uint64_t start_height, const std::vector<cryptonote::block_complete_entry> &blocks, const std::vector<parsed_block> &parsed_blocks, uint64_t& blocks_added, std::pair<std::map<std::pair<uint64_t, uint64_t>, size_t>, std::map<std::pair<std::array<char, 32>, size_t>, size_t>> *output_tracker_cache = NULL);
1405  uint64_t select_transfers(uint64_t needed_etn, std::vector<size_t> unused_transfers_indices, std::vector<size_t>& selected_transfers) const;
1406  bool prepare_file_names(const std::string& file_path);
1407  void process_unconfirmed(const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t height);
1408  void process_outgoing(const crypto::hash &txid, const cryptonote::transaction& tx, uint64_t height, uint64_t ts, uint64_t spent, uint64_t received, uint32_t subaddr_account, const std::set<uint32_t>& subaddr_indices);
1409  void add_unconfirmed_tx(const cryptonote::transaction& tx, uint64_t amount_in, const std::vector<cryptonote::tx_destination_entry> &dests, const crypto::hash &payment_id, uint64_t change_amount, uint32_t subaddr_account, const std::set<uint32_t>& subaddr_indices);
1410  void generate_genesis(cryptonote::block& b) const;
1411  void check_genesis(const crypto::hash& genesis_hash) const; //throws
1412  bool generate_chacha_key_from_secret_keys(crypto::chacha_key &key) const;
1413  void generate_chacha_key_from_password(const epee::wipeable_string &pass, crypto::chacha_key &key) const;
1414  crypto::hash get_payment_id(const pending_tx &ptx) const;
1415  void check_acc_out_precomp(const cryptonote::tx_out &o, const crypto::key_derivation &derivation, const std::vector<crypto::key_derivation> &additional_derivations, size_t i, tx_scan_info_t &tx_scan_info) const;
1416  void check_acc_out_precomp(const cryptonote::tx_out &o, const crypto::key_derivation &derivation, const std::vector<crypto::key_derivation> &additional_derivations, size_t i, const is_out_data *is_out_data, tx_scan_info_t &tx_scan_info) const;
1417  void check_acc_out_precomp_once(const cryptonote::tx_out &o, const crypto::key_derivation &derivation, const std::vector<crypto::key_derivation> &additional_derivations, size_t i, const is_out_data *is_out_data, tx_scan_info_t &tx_scan_info, bool &already_seen) const;
1418  void parse_block_round(const cryptonote::blobdata &blob, cryptonote::block &bl, crypto::hash &bl_id, bool &error) const;
1419  uint64_t get_upper_transaction_weight_limit() const;
1420  std::vector<uint64_t> get_unspent_amounts_vector() const;
1421  uint64_t get_dynamic_base_fee_estimate() const;
1422  float get_output_relatedness(const transfer_details &td0, const transfer_details &td1) const;
1423  std::vector<size_t> pick_preferred_rct_inputs(uint64_t needed_etn, uint32_t subaddr_account, const std::set<uint32_t> &subaddr_indices) const;
1424  void set_spent(size_t idx, uint64_t height, bool public_out = false);
1425  void set_unspent(size_t idx, bool public_out = false);
1426  void get_outs(std::vector<std::vector<get_outs_entry>> &outs, const std::vector<size_t> &selected_transfers, size_t fake_outputs_count, const uint8_t tx_version);
1427  bool tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs, uint64_t global_index, const crypto::public_key& tx_public_key, const rct::key& mask, uint64_t real_index, bool unlocked) const;
1428  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;
1429  std::vector<size_t> get_only_rct(const std::vector<size_t> &unused_dust_indices, const std::vector<size_t> &unused_transfers_indices) const;
1430  void scan_output(const cryptonote::transaction &tx, bool miner_tx, const crypto::public_key &tx_pub_key, size_t i, tx_scan_info_t &tx_scan_info, int &num_vouts_received, std::unordered_map<cryptonote::subaddress_index, uint64_t> &tx_etn_got_in_outs, std::vector<size_t> &outs, bool pool);
1431  void trim_hashchain();
1432  crypto::key_image get_multisig_composite_key_image(size_t n) const;
1433  rct::multisig_kLRki get_multisig_composite_kLRki(size_t n, const std::unordered_set<crypto::public_key> &ignore_set, std::unordered_set<rct::key> &used_L, std::unordered_set<rct::key> &new_used_L) const;
1434  rct::multisig_kLRki get_multisig_kLRki(size_t n, const rct::key &k) const;
1435  rct::key get_multisig_k(size_t idx, const std::unordered_set<rct::key> &used_L) const;
1436  void update_multisig_rescan_info(const std::vector<std::vector<rct::key>> &multisig_k, const std::vector<std::vector<tools::wallet2::multisig_info>> &info, size_t n);
1437  bool add_rings(const crypto::chacha_key &key, const cryptonote::transaction_prefix &tx);
1438  bool add_rings(const cryptonote::transaction_prefix &tx);
1439  bool remove_rings(const cryptonote::transaction_prefix &tx);
1440  bool get_ring(const crypto::chacha_key &key, const crypto::key_image &key_image, std::vector<uint64_t> &outs);
1441  crypto::chacha_key get_ringdb_key();
1442  void setup_keys(const epee::wipeable_string &password);
1443  size_t get_transfer_details(const crypto::key_image &ki) const;
1444 
1445  void register_devices();
1446  hw::device& lookup_device(const std::string & device_descriptor);
1447 
1448  bool get_rct_distribution(uint64_t &start_height, std::vector<uint64_t> &distribution);
1449 
1450  uint64_t get_segregation_fork_height() const;
1451  void unpack_multisig_info(const std::vector<std::string>& info,
1452  std::vector<crypto::public_key> &public_keys,
1453  std::vector<crypto::secret_key> &secret_keys) const;
1454  bool unpack_extra_multisig_info(const std::vector<std::string>& info,
1455  std::vector<crypto::public_key> &signers,
1456  std::unordered_set<crypto::public_key> &pkeys) const;
1457 
1458  // This caches pubkeys (stealths) only and nothing to do with whether we own an output. Typically ran in a new thread whilst the wallet deals with new blocks (and tx) one by one.
1459  void cache_tx_data(const cryptonote::transaction& tx, const crypto::hash &txid, tx_cache_data &tx_cache_data) const;
1460  //it is a pair of maps: one is (amount, global idx):m_transfers index and the other is (tx hash, relative out index):m_transfers index
1461  std::shared_ptr<std::pair<std::map<std::pair<uint64_t, uint64_t>, size_t>, std::map<std::pair<std::array<char, 32>, size_t>, size_t>>> create_output_tracker_cache() const;
1462 
1463  void init_type(hw::device::device_type device_type);
1464  void setup_new_blockchain();
1465  void create_keys_file(const std::string &wallet_, bool watch_only, const epee::wipeable_string &password, bool create_address_file);
1466 
1467  wallet_device_callback * get_device_callback();
1468  void on_device_button_request(uint64_t code);
1469  void on_device_button_pressed();
1470  boost::optional<epee::wipeable_string> on_device_pin_request();
1471  boost::optional<epee::wipeable_string> on_device_passphrase_request(bool on_device);
1472  void on_device_progress(const hw::device_progress& event);
1473 
1474  std::string get_rpc_status(const std::string &s) const;
1475  void throw_on_rpc_response_error(const boost::optional<std::string> &status, const char *method) const;
1476 
1477  cryptonote::blobdata get_pruned_tx_blob(const cryptonote::blobdata &blobdata);
1478 
1479 
1480  cryptonote::account_base m_account;
1481  boost::optional<epee::net_utils::http::login> m_daemon_login;
1482  std::string m_daemon_address;
1483  std::string m_wallet_file;
1484  std::string m_keys_file;
1485  std::string m_mms_file;
1487  hashchain m_blockchain;
1488  std::unordered_map<crypto::hash, unconfirmed_transfer_details> m_unconfirmed_txs;
1489  std::unordered_map<crypto::hash, confirmed_transfer_details> m_confirmed_txs;
1490  std::unordered_multimap<crypto::hash, pool_payment_details> m_unconfirmed_payments;
1491  std::unordered_map<crypto::hash, crypto::secret_key> m_tx_keys;
1492  cryptonote::checkpoints m_checkpoints;
1493  uint64_t fallback_to_pow_checkpoint_height;
1494  std::string fallback_to_pow_checkpoint_hash;
1495  std::unordered_map<crypto::hash, std::vector<crypto::secret_key>> m_additional_tx_keys;
1496 
1497  transfer_container m_transfers;
1498  payment_container m_payments;
1499  std::unordered_map<crypto::key_image, size_t> m_key_images;
1500  std::unordered_map<crypto::public_key, size_t> m_pub_keys;
1501  std::unordered_map<std::pair<crypto::hash, size_t>, size_t, boost::hash<std::pair<crypto::hash, size_t>>> m_chainstate_indexes; // map of chainstate identifier (txhash, relative out index) to 'm_transfers index'
1502  cryptonote::account_public_address m_account_public_address;
1503  std::unordered_map<crypto::public_key, cryptonote::subaddress_index> m_subaddresses;
1504  std::vector<std::vector<std::string>> m_subaddress_labels;
1505  std::unordered_map<crypto::hash, std::string> m_tx_notes;
1506  std::unordered_map<std::string, std::string> m_attributes;
1507  std::vector<tools::wallet2::address_book_row> m_address_book;
1508  std::pair<std::map<std::string, std::string>, std::vector<std::string>> m_account_tags;
1509  uint64_t m_upper_transaction_weight_limit; //TODO: auto-calc this value or request from daemon, now use some fixed value
1510  const std::vector<std::vector<tools::wallet2::multisig_info>> *m_multisig_rescan_info;
1511  const std::vector<std::vector<rct::key>> *m_multisig_rescan_k;
1512  std::unordered_map<crypto::public_key, crypto::key_image> m_cold_key_images;
1513 
1514  std::atomic<bool> m_run;
1515 
1516  boost::recursive_mutex m_daemon_rpc_mutex;
1517 
1518  bool m_trusted_daemon;
1519  i_wallet2_callback* m_callback;
1520  hw::device::device_type m_key_device_type;
1521  cryptonote::network_type m_nettype;
1522  uint64_t m_kdf_rounds;
1523  std::string seed_language;
1524  bool is_old_file_format;
1525  bool m_watch_only;
1526  bool m_multisig;
1527  uint32_t m_multisig_threshold;
1528  std::vector<crypto::public_key> m_multisig_signers;
1529  //in case of general M/N multisig wallet we should perform N - M + 1 key exchange rounds and remember how many rounds are passed.
1530  uint32_t m_multisig_rounds_passed;
1531  std::vector<crypto::public_key> m_multisig_derivations;
1532  bool m_always_confirm_transfers;
1533  bool m_print_ring_members;
1534  bool m_store_tx_info;
1535  uint32_t m_default_mixin;
1536  uint32_t m_default_priority;
1537  RefreshType m_refresh_type;
1538  bool m_auto_refresh;
1539  bool m_first_refresh_done;
1540  uint64_t m_refresh_from_block_height;
1541  // If m_refresh_from_block_height is explicitly set to zero we need this to differentiate it from the case that
1542  // m_refresh_from_block_height was defaulted to zero.*/
1543  bool m_explicit_refresh_from_block_height;
1544  bool m_confirm_missing_payment_id;
1545  bool m_confirm_non_default_ring_size;
1546  AskPasswordType m_ask_password;
1547  uint32_t m_min_output_count;
1548  uint64_t m_min_output_value;
1549  bool m_merge_destinations;
1550  bool m_confirm_backlog;
1551  uint32_t m_confirm_backlog_threshold;
1552  bool m_confirm_export_overwrite;
1553  bool m_auto_low_priority;
1554  bool m_segregate_pre_fork_outputs;
1555  bool m_key_reuse_mitigation2;
1556  uint64_t m_segregation_height;
1557  bool m_ignore_fractional_outputs;
1558  bool m_track_uses;
1559  BackgroundMiningSetupType m_setup_background_mining;
1560  bool m_is_initialized;
1561  NodeRPCProxy m_node_rpc_proxy;
1562  std::unordered_set<crypto::hash> m_scanned_pool_txs[2];
1563  size_t m_subaddress_lookahead_major, m_subaddress_lookahead_minor;
1564  std::string m_device_name;
1565  std::string m_device_derivation_path;
1566  uint64_t m_device_last_key_image_sync;
1567  bool m_use_dns;
1568  bool m_offline;
1569 
1570  // Aux transaction data from device
1571  std::unordered_map<crypto::hash, std::string> m_tx_device;
1572 
1573  // Light wallet
1574  bool m_light_wallet; /* sends view key to daemon for scanning */
1575  uint64_t m_light_wallet_scanned_block_height;
1576  uint64_t m_light_wallet_blockchain_height;
1577  uint64_t m_light_wallet_per_kb_fee = FEE_PER_KB;
1578  bool m_light_wallet_connected;
1579  uint64_t m_light_wallet_balance;
1580  uint64_t m_light_wallet_unlocked_balance;
1581  // Light wallet info needed to populate m_payment requires 2 separate api calls (get_address_txs and get_unspent_outs)
1582  // We save the info from the first call in m_light_wallet_address_txs for easier lookup.
1583  std::unordered_map<crypto::hash, address_tx> m_light_wallet_address_txs;
1584  // store calculated key image for faster lookup
1585  std::unordered_map<crypto::public_key, std::map<uint64_t, crypto::key_image> > m_key_image_cache;
1586 
1587  std::string m_ring_database;
1588  bool m_ring_history_saved;
1589  std::unique_ptr<ringdb> m_ringdb;
1590  boost::optional<crypto::chacha_key> m_ringdb_key;
1591 
1592  uint64_t m_last_block_reward;
1593  std::unique_ptr<tools::file_locker> m_keys_file_locker;
1594 
1595  mms::message_store m_message_store;
1596  bool m_original_keys_available;
1597  cryptonote::account_public_address m_original_address;
1598  crypto::secret_key m_original_view_secret_key;
1599 
1600  crypto::chacha_key m_cache_key;
1601  boost::optional<epee::wipeable_string> m_encrypt_keys_after_refresh;
1602 
1603  bool m_unattended;
1604  bool m_devices_registered;
1605 
1606  std::shared_ptr<tools::Notify> m_tx_notify;
1607  std::unique_ptr<wallet_device_callback> m_device_callback;
1608 
1609  bool m_display_progress_indicator;
1610 
1611  uint32_t m_account_major_offset;
1612  };
1613 }
1615 BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 12)
1616 BOOST_CLASS_VERSION(tools::wallet2::multisig_info, 1)
1617 BOOST_CLASS_VERSION(tools::wallet2::multisig_info::LR, 0)
1618 BOOST_CLASS_VERSION(tools::wallet2::multisig_tx_set, 1)
1619 BOOST_CLASS_VERSION(tools::wallet2::payment_details, 4)
1620 BOOST_CLASS_VERSION(tools::wallet2::pool_payment_details, 1)
1621 BOOST_CLASS_VERSION(tools::wallet2::unconfirmed_transfer_details, 8)
1622 BOOST_CLASS_VERSION(tools::wallet2::confirmed_transfer_details, 7)
1623 BOOST_CLASS_VERSION(tools::wallet2::address_book_row, 17)
1624 BOOST_CLASS_VERSION(tools::wallet2::reserve_proof_entry, 0)
1626 BOOST_CLASS_VERSION(tools::wallet2::signed_tx_set, 1)
1628 BOOST_CLASS_VERSION(tools::wallet2::pending_tx, 3)
1629 BOOST_CLASS_VERSION(tools::wallet2::multisig_sig, 0)
1630 
1631 namespace boost
1632 {
1633  namespace serialization
1634  {
1635  template <class Archive>
1636  inline typename std::enable_if<!Archive::is_loading::value, void>::type initialize_transfer_details(Archive &a, tools::wallet2::transfer_details &x, const boost::serialization::version_type ver)
1637  {
1638  }
1639  template <class Archive>
1640  inline typename std::enable_if<Archive::is_loading::value, void>::type initialize_transfer_details(Archive &a, tools::wallet2::transfer_details &x, const boost::serialization::version_type ver)
1641  {
1642  if (ver < 1)
1643  {
1644  x.m_mask = rct::identity();
1645  x.m_amount = x.m_tx.vout[x.m_internal_output_index].amount;
1646  }
1647  if (ver < 2)
1648  {
1649  x.m_spent_height = 0;
1650  }
1651  if (ver < 4)
1652  {
1653  x.m_rct = x.m_tx.vout[x.m_internal_output_index].amount == 0;
1654  }
1655  if (ver < 6)
1656  {
1657  x.m_key_image_known = true;
1658  }
1659  if (ver < 7)
1660  {
1661  x.m_pk_index = 0;
1662  }
1663  if (ver < 8)
1664  {
1665  x.m_subaddr_index = {};
1666  }
1667  if (ver < 9)
1668  {
1669  x.m_key_image_partial = false;
1670  x.m_multisig_k.clear();
1671  x.m_multisig_info.clear();
1672  }
1673  if (ver < 10)
1674  {
1675  x.m_key_image_request = false;
1676  }
1677  if (ver < 12)
1678  {
1679  x.m_frozen = false;
1680  }
1681  }
1682 
1683  template <class Archive>
1684  inline void serialize(Archive &a, tools::wallet2::transfer_details &x, const boost::serialization::version_type ver)
1685  {
1686  a & x.m_block_height;
1689  if (ver < 3)
1690  {
1692  a & tx;
1693  x.m_tx = (const cryptonote::transaction_prefix&)tx;
1695  }
1696  else
1697  {
1698  a & x.m_tx;
1699  }
1700  a & x.m_spent;
1701  a & x.m_key_image;
1702  if (ver < 1)
1703  {
1704  // ensure mask and amount are set
1705  initialize_transfer_details(a, x, ver);
1706  return;
1707  }
1708  a & x.m_mask;
1709  a & x.m_amount;
1710  if (ver < 2)
1711  {
1712  initialize_transfer_details(a, x, ver);
1713  return;
1714  }
1715  a & x.m_spent_height;
1716  if (ver < 3)
1717  {
1718  initialize_transfer_details(a, x, ver);
1719  return;
1720  }
1721  a & x.m_txid;
1722  if (ver < 4)
1723  {
1724  initialize_transfer_details(a, x, ver);
1725  return;
1726  }
1727  a & x.m_rct;
1728  if (ver < 5)
1729  {
1730  initialize_transfer_details(a, x, ver);
1731  return;
1732  }
1733  if (ver < 6)
1734  {
1735  // v5 did not properly initialize
1736  uint8_t u;
1737  a & u;
1738  x.m_key_image_known = true;
1739  return;
1740  }
1741  a & x.m_key_image_known;
1742  if (ver < 7)
1743  {
1744  initialize_transfer_details(a, x, ver);
1745  return;
1746  }
1747  a & x.m_pk_index;
1748  if (ver < 8)
1749  {
1750  initialize_transfer_details(a, x, ver);
1751  return;
1752  }
1753  a & x.m_subaddr_index;
1754  if (ver < 9)
1755  {
1756  initialize_transfer_details(a, x, ver);
1757  return;
1758  }
1759  a & x.m_multisig_info;
1760  a & x.m_multisig_k;
1761  a & x.m_key_image_partial;
1762  if (ver < 10)
1763  {
1764  initialize_transfer_details(a, x, ver);
1765  return;
1766  }
1767  a & x.m_key_image_request;
1768  if (ver < 11)
1769  {
1770  initialize_transfer_details(a, x, ver);
1771  return;
1772  }
1773  a & x.m_uses;
1774  if (ver < 12)
1775  {
1776  initialize_transfer_details(a, x, ver);
1777  return;
1778  }
1779  a & x.m_frozen;
1780  }
1781 
1782  template <class Archive>
1783  inline void serialize(Archive &a, tools::wallet2::multisig_info::LR &x, const boost::serialization::version_type ver)
1784  {
1785  a & x.m_L;
1786  a & x.m_R;
1787  }
1788 
1789  template <class Archive>
1790  inline void serialize(Archive &a, tools::wallet2::multisig_info &x, const boost::serialization::version_type ver)
1791  {
1792  a & x.m_signer;
1793  a & x.m_LR;
1794  a & x.m_partial_key_images;
1795  }
1796 
1797  template <class Archive>
1798  inline void serialize(Archive &a, tools::wallet2::multisig_tx_set &x, const boost::serialization::version_type ver)
1799  {
1800  a & x.m_ptx;
1801  a & x.m_signers;
1802  }
1803 
1804  template <class Archive>
1805  inline void serialize(Archive &a, tools::wallet2::unconfirmed_transfer_details &x, const boost::serialization::version_type ver)
1806  {
1807  a & x.m_change;
1808  a & x.m_sent_time;
1809  if (ver < 5)
1810  {
1812  a & tx;
1813  x.m_tx = (const cryptonote::transaction_prefix&)tx;
1814  }
1815  else
1816  {
1817  a & x.m_tx;
1818  }
1819  if (ver < 1)
1820  return;
1821  a & x.m_dests;
1822  a & x.m_payment_id;
1823  if (ver < 2)
1824  return;
1825  a & x.m_state;
1826  if (ver < 3)
1827  return;
1828  a & x.m_timestamp;
1829  if (ver < 4)
1830  return;
1831  a & x.m_amount_in;
1832  a & x.m_amount_out;
1833  if (ver < 6)
1834  {
1835  // v<6 may not have change accumulated in m_amount_out, which is a pain,
1836  // as it's readily understood to be sum of outputs.
1837  // We convert it to include change from v6
1838  if (!typename Archive::is_saving() && x.m_change != (uint64_t)-1)
1839  x.m_amount_out += x.m_change;
1840  }
1841  if (ver < 7)
1842  {
1843  x.m_subaddr_account = 0;
1844  return;
1845  }
1846  a & x.m_subaddr_account;
1847  a & x.m_subaddr_indices;
1848  if (ver < 8)
1849  return;
1850  a & x.m_rings;
1851  }
1852 
1853  template <class Archive>
1854  inline void serialize(Archive &a, tools::wallet2::confirmed_transfer_details &x, const boost::serialization::version_type ver)
1855  {
1856  a & x.m_amount_in;
1857  a & x.m_amount_out;
1858  a & x.m_change;
1859  a & x.m_block_height;
1860  if (ver < 1)
1861  return;
1862  a & x.m_dests;
1863  a & x.m_payment_id;
1864  if (ver < 2)
1865  return;
1866  a & x.m_timestamp;
1867  if (ver < 3)
1868  {
1869  // v<3 may not have change accumulated in m_amount_out, which is a pain,
1870  // as it's readily understood to be sum of outputs. Whether it got added
1871  // or not depends on whether it came from a unconfirmed_transfer_details
1872  // (not included) or not (included). We can't reliably tell here, so we
1873  // check whether either yields a "negative" fee, or use the other if so.
1874  // We convert it to include change from v3
1875  if (!typename Archive::is_saving() && x.m_change != (uint64_t)-1)
1876  {
1877  if (x.m_amount_in > (x.m_amount_out + x.m_change))
1878  x.m_amount_out += x.m_change;
1879  }
1880  }
1881  if (ver < 4)
1882  {
1883  if (!typename Archive::is_saving())
1884  x.m_unlock_time = 0;
1885  return;
1886  }
1887  a & x.m_unlock_time;
1888  if (ver < 5)
1889  {
1890  x.m_subaddr_account = 0;
1891  return;
1892  }
1893  a & x.m_subaddr_account;
1894  a & x.m_subaddr_indices;
1895  if (ver < 6)
1896  return;
1897  a & x.m_rings;
1898  if(ver < 7)
1899  return;
1900  a & x.m_is_migration;
1901  }
1902 
1903  template <class Archive>
1904  inline void serialize(Archive& a, tools::wallet2::payment_details& x, const boost::serialization::version_type ver)
1905  {
1906  a & x.m_tx_hash;
1907  a & x.m_amount;
1908  a & x.m_block_height;
1909  a & x.m_unlock_time;
1910  if (ver < 1)
1911  return;
1912  a & x.m_timestamp;
1913  if (ver < 2)
1914  {
1915  x.m_coinbase = false;
1916  x.m_subaddr_index = {};
1917  return;
1918  }
1919  a & x.m_subaddr_index;
1920  if (ver < 3)
1921  {
1922  x.m_coinbase = false;
1923  x.m_fee = 0;
1924  return;
1925  }
1926  a & x.m_fee;
1927  if (ver < 4)
1928  {
1929  x.m_coinbase = false;
1930  return;
1931  }
1932  a & x.m_coinbase;
1933  }
1934 
1935  template <class Archive>
1936  inline void serialize(Archive& a, tools::wallet2::pool_payment_details& x, const boost::serialization::version_type ver)
1937  {
1938  a & x.m_pd;
1939  a & x.m_double_spend_seen;
1941  }
1942 
1943  template <class Archive>
1944  inline void serialize(Archive& a, tools::wallet2::address_book_row& x, const boost::serialization::version_type ver)
1945  {
1946  a & x.m_address;
1947  a & x.m_payment_id;
1948  a & x.m_description;
1949  if (ver < 17)
1950  {
1951  x.m_is_subaddress = false;
1952  return;
1953  }
1954  a & x.m_is_subaddress;
1955  }
1956 
1957  template <class Archive>
1958  inline void serialize(Archive& a, tools::wallet2::reserve_proof_entry& x, const boost::serialization::version_type ver)
1959  {
1960  a & x.txid;
1961  a & x.index_in_tx;
1962  a & x.shared_secret;
1963  a & x.key_image;
1964  a & x.shared_secret_sig;
1965  a & x.key_image_sig;
1966  }
1967 
1968  template <class Archive>
1969  inline void serialize(Archive &a, tools::wallet2::unsigned_tx_set &x, const boost::serialization::version_type ver)
1970  {
1971  a & x.txes;
1972  a & x.transfers;
1973  }
1974 
1975  template <class Archive>
1976  inline void serialize(Archive &a, tools::wallet2::signed_tx_set &x, const boost::serialization::version_type ver)
1977  {
1978  a & x.ptx;
1979  a & x.key_images;
1980  if (ver < 1)
1981  return;
1982  a & x.tx_key_images;
1983  }
1984 
1985  template <class Archive>
1986  inline void serialize(Archive &a, tools::wallet2::tx_construction_data &x, const boost::serialization::version_type ver)
1987  {
1988  a & x.sources;
1989  a & x.change_dts;
1990  a & x.splitted_dsts;
1991  if (ver < 2)
1992  {
1993  // load list to vector
1994  std::list<size_t> selected_transfers;
1995  a & selected_transfers;
1996  x.selected_transfers.clear();
1997  x.selected_transfers.reserve(selected_transfers.size());
1998  for (size_t t: selected_transfers)
1999  x.selected_transfers.push_back(t);
2000  }
2001  a & x.extra;
2002  a & x.unlock_time;
2003  a & x.use_rct;
2004  a & x.dests;
2005  if (ver < 1)
2006  {
2007  x.subaddr_account = 0;
2008  return;
2009  }
2010  a & x.subaddr_account;
2011  a & x.subaddr_indices;
2012  if (ver < 2)
2013  {
2014  if (!typename Archive::is_saving())
2016  return;
2017  }
2018  a & x.selected_transfers;
2019  if (ver < 3)
2020  {
2021  if (!typename Archive::is_saving())
2023  return;
2024  }
2025  if (ver < 4)
2026  {
2027  bool use_bulletproofs = x.rct_config.range_proof_type != rct::RangeProofBorromean;
2028  a & use_bulletproofs;
2029  if (!typename Archive::is_saving())
2030  x.rct_config = { use_bulletproofs ? rct::RangeProofBulletproof : rct::RangeProofBorromean, 0 };
2031  return;
2032  }
2033  a & x.rct_config;
2034  }
2035 
2036  template <class Archive>
2037  inline void serialize(Archive &a, tools::wallet2::multisig_sig &x, const boost::serialization::version_type ver)
2038  {
2039  a & x.sigs;
2040  a & x.ignore;
2041  a & x.used_L;
2042  a & x.signing_keys;
2043  a & x.msout;
2044  }
2045 
2046  template <class Archive>
2047  inline void serialize(Archive &a, tools::wallet2::pending_tx &x, const boost::serialization::version_type ver)
2048  {
2049  a & x.tx;
2050  a & x.dust;
2051  a & x.fee;
2052  a & x.dust_added_to_fee;
2053  a & x.change_dts;
2054  if (ver < 2)
2055  {
2056  // load list to vector
2057  std::list<size_t> selected_transfers;
2058  a & selected_transfers;
2059  x.selected_transfers.clear();
2060  x.selected_transfers.reserve(selected_transfers.size());
2061  for (size_t t: selected_transfers)
2062  x.selected_transfers.push_back(t);
2063  }
2064  a & x.key_images;
2065  a & x.tx_key;
2066  a & x.dests;
2067  a & x.construction_data;
2068  if (ver < 1)
2069  return;
2070  a & x.additional_tx_keys;
2071  if (ver < 2)
2072  return;
2073  a & x.selected_transfers;
2074  if (ver < 3)
2075  return;
2076  a & x.multisig_sigs;
2077  }
2078  }
2079 }
2080 
2081 namespace tools
2082 {
2083 
2084  namespace detail
2085  {
2086  //----------------------------------------------------------------------------------------------------
2087  inline void digit_split_strategy(const std::vector<cryptonote::tx_destination_entry>& dsts,
2088  const cryptonote::tx_destination_entry& change_dst, uint64_t dust_threshold,
2089  std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2090  {
2091  splitted_dsts.clear();
2092  dust_dsts.clear();
2093 
2094  for(auto& de: dsts)
2095  {
2097  [&](uint64_t chunk) { splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, de.addr, de.is_subaddress)); },
2098  [&](uint64_t a_dust) { splitted_dsts.push_back(cryptonote::tx_destination_entry(a_dust, de.addr, de.is_subaddress)); } );
2099  }
2100 
2102  [&](uint64_t chunk) {
2103  if (chunk <= dust_threshold)
2104  dust_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, change_dst.is_subaddress));
2105  else
2106  splitted_dsts.push_back(cryptonote::tx_destination_entry(chunk, change_dst.addr, change_dst.is_subaddress));
2107  },
2108  [&](uint64_t a_dust) { dust_dsts.push_back(cryptonote::tx_destination_entry(a_dust, change_dst.addr, change_dst.is_subaddress)); } );
2109  }
2110  //----------------------------------------------------------------------------------------------------
2111  inline void null_split_strategy(const std::vector<cryptonote::tx_destination_entry>& dsts,
2112  const cryptonote::tx_destination_entry& change_dst, uint64_t dust_threshold,
2113  std::vector<cryptonote::tx_destination_entry>& splitted_dsts, std::vector<cryptonote::tx_destination_entry> &dust_dsts)
2114  {
2115  splitted_dsts = dsts;
2116 
2117  dust_dsts.clear();
2118  uint64_t change = change_dst.amount;
2119 
2120  if (0 != change)
2121  {
2122  splitted_dsts.push_back(cryptonote::tx_destination_entry(change, change_dst.addr, false));
2123  }
2124  }
2125  //----------------------------------------------------------------------------------------------------
2127  {
2128  std::string indexes;
2129  std::for_each(src.outputs.begin(), src.outputs.end(), [&](const cryptonote::tx_source_entry::output_entry& s_e) { indexes += boost::to_string(s_e.first) + " "; });
2130  LOG_PRINT_L0("amount=" << cryptonote::print_etn(src.amount) << ", real_output=" <<src.real_output << ", real_output_in_tx_index=" << src.real_output_in_tx_index << ", indexes: " << indexes);
2131  }
2132  //----------------------------------------------------------------------------------------------------
2133  }
2134  //----------------------------------------------------------------------------------------------------
2135 }
return true
uint64_t height
Definition: blockchain.cpp:91
time_t time
Definition: blockchain.cpp:93
uint8_t threshold
Definition: blockchain.cpp:92
A container for blockchain checkpoints.
Definition: checkpoints.h:52
Non-owning sequence of data. Does not deep copy.
Definition: span.h:57
gamma_picker(const std::vector< uint64_t > &rct_offsets)
Definition: wallet2.cpp:1010
void crop(size_t height)
Definition: wallet2.h:188
void clear()
Definition: wallet2.h:189
bool is_in_bounds(size_t idx) const
Definition: wallet2.h:185
size_t offset() const
Definition: wallet2.h:182
crypto::hash & operator[](size_t idx)
Definition: wallet2.h:187
void trim(size_t height)
Definition: wallet2.h:191
const crypto::hash & operator[](size_t idx) const
Definition: wallet2.h:186
void push_back(const crypto::hash &hash)
Definition: wallet2.h:184
bool empty() const
Definition: wallet2.h:190
void serialize(t_archive &a, const unsigned int ver)
Definition: wallet2.h:195
void refill(const crypto::hash &hash)
Definition: wallet2.h:192
const crypto::hash & genesis() const
Definition: wallet2.h:183
size_t size() const
Definition: wallet2.h:181
virtual void on_etn_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx, uint64_t amount, const cryptonote::subaddress_index &subaddr_index, uint64_t unlock_time)
Definition: wallet2.h:128
virtual void on_lw_unconfirmed_etn_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
Definition: wallet2.h:136
virtual void on_device_button_pressed()
Definition: wallet2.h:140
virtual boost::optional< epee::wipeable_string > on_get_password(const char *reason)
Definition: wallet2.h:132
virtual void on_pool_tx_removed(const crypto::hash &txid)
Definition: wallet2.h:145
virtual void on_device_button_request(uint64_t code)
Definition: wallet2.h:139
virtual void on_etn_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: wallet2.h:130
virtual void on_new_block(uint64_t height, const cryptonote::block &block)
Definition: wallet2.h:127
virtual ~i_wallet2_callback()
Definition: wallet2.h:146
virtual void on_unconfirmed_etn_received(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx, uint64_t amount, const cryptonote::subaddress_index &subaddr_index)
Definition: wallet2.h:129
virtual boost::optional< epee::wipeable_string > on_device_passphrase_request(bool on_device)
Definition: wallet2.h:142
virtual void on_lw_etn_spent(uint64_t height, const crypto::hash &txid, uint64_t amount)
Definition: wallet2.h:137
virtual boost::optional< epee::wipeable_string > on_device_pin_request()
Definition: wallet2.h:141
virtual void on_skip_transaction(uint64_t height, const crypto::hash &txid, const cryptonote::transaction &tx)
Definition: wallet2.h:131
virtual void on_lw_etn_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
Definition: wallet2.h:135
virtual void on_lw_new_block(uint64_t height)
Definition: wallet2.h:134
virtual void on_device_progress(const hw::device_progress &event)
Definition: wallet2.h:143
bool get_multisig_seed(epee::wipeable_string &seed, const epee::wipeable_string &passphrase=std::string(), bool raw=true) const
Definition: wallet2.cpp:1326
void expand_subaddresses(const cryptonote::subaddress_index &index, const bool udpate_account_tags=true)
Definition: wallet2.cpp:1477
uint64_t get_max_ring_size() const
Definition: wallet2.cpp:7644
std::string exchange_multisig_keys(const epee::wipeable_string &password, const std::vector< std::string > &info)
Definition: wallet2.cpp:5170
bool add_address_book_row(const cryptonote::account_public_address &address, const crypto::hash &payment_id, const std::string &description, bool is_subaddress)
Definition: wallet2.cpp:3434
bool sanity_check(const std::vector< wallet2::pending_tx > &ptx_vector, std::vector< cryptonote::tx_destination_entry > dsts) const
Definition: wallet2.cpp:10070
bool unlock_keys_file()
Definition: wallet2.cpp:8015
bool parse_unsigned_tx_from_str(const std::string &unsigned_tx_st, unsigned_tx_set &exported_txs) const
Definition: wallet2.cpp:6832
static const char * tr(const char *str)
Definition: wallet2.cpp:993
uint32_t get_confirm_backlog_threshold() const
Definition: wallet2.h:1082
static bool has_testnet_option(const boost::program_options::variables_map &vm)
Definition: wallet2.cpp:1172
bool set_daemon(std::string daemon_address="http://localhost:8080", boost::optional< epee::net_utils::http::login > daemon_login=boost::none, bool trusted_daemon=true, epee::net_utils::ssl_options_t ssl_options=epee::net_utils::ssl_support_t::e_ssl_support_autodetect)
Definition: wallet2.cpp:1267
cryptonote::blobdata export_multisig()
Definition: wallet2.cpp:12774
bool segregate_pre_fork_outputs() const
Definition: wallet2.h:1087
bool is_tx_spendtime_unlocked(uint64_t unlock_time, uint64_t block_height) const
Definition: wallet2.cpp:6383
void auto_refresh(bool r)
Definition: wallet2.h:1068
void key_reuse_mitigation2(bool value)
Definition: wallet2.h:1090
bool is_unattended() const
Definition: wallet2.h:1266
bool load_unsigned_tx(const std::string &unsigned_filename, unsigned_tx_set &exported_txs) const
Definition: wallet2.cpp:6813
crypto::public_key get_multisig_signing_public_key(size_t idx) const
Definition: wallet2.cpp:12694
bool watch_only() const
Definition: wallet2.h:819
std::vector< wallet2::pending_tx > create_transactions_2(std::vector< cryptonote::tx_destination_entry > dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector< uint8_t > &extra, uint32_t subaddr_account, std::set< uint32_t > subaddr_indices)
Definition: wallet2.cpp:9515
uint64_t get_base_fee() const
Definition: wallet2.cpp:7584
void set_trusted_daemon(bool trusted)
Definition: wallet2.h:760
bool merge_destinations() const
Definition: wallet2.h:1078
void always_confirm_transfers(bool always)
Definition: wallet2.h:1058
bool sign_multisig_tx_to_file(multisig_tx_set &exported_txs, const std::string &filename, std::vector< crypto::hash > &txids)
Definition: wallet2.cpp:7509
void light_wallet_get_address_txs()
Definition: wallet2.cpp:9244
size_t import_multisig(std::vector< cryptonote::blobdata > info)
Definition: wallet2.cpp:12847
void load(const std::string &wallet, const epee::wipeable_string &password)
Definition: wallet2.cpp:5723
uint64_t balance_all(bool public_blockchain) const
Definition: wallet2.cpp:6182
bool invoke_http_json(const boost::string_ref uri, const t_request &req, t_response &res, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET")
Definition: wallet2.h:1311
std::string export_outputs_to_str(bool all=false) const
Definition: wallet2.cpp:12524
void default_mixin(uint32_t m)
Definition: wallet2.h:1064
std::string encrypt(const char *plaintext, size_t len, const crypto::secret_key &skey, bool authenticated=true) const
Definition: wallet2.cpp:12961
uint64_t get_num_rct_outputs()
Definition: wallet2.cpp:10621
void rescan_blockchain(bool hard, bool refresh=true, bool keep_key_images=false)
Definition: wallet2.cpp:6339
uint64_t cold_key_image_sync(uint64_t &spent, uint64_t &unspent)
Definition: wallet2.cpp:10484
void add_checkpoint(uint64_t height, std::string hash)
Definition: wallet2.cpp:13546
std::vector< wallet2::pending_tx > create_transactions_single(const crypto::key_image &ki, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector< uint8_t > &extra)
Definition: wallet2.cpp:10206
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 boost::optional< uint32_t > &subaddr_account=boost::none, const std::set< uint32_t > &subaddr_indices={}) const
Definition: wallet2.cpp:6236
static std::pair< std::unique_ptr< wallet2 >, password_container > make_new(const boost::program_options::variables_map &vm, bool unattended, const std::function< boost::optional< password_container >(const char *, bool)> &password_prompter)
Uses stdin and stdout. Returns a wallet2 and password for wallet with no file if no errors.
Definition: wallet2.cpp:1249
void track_uses(bool value)
Definition: wallet2.h:1098
void refresh(bool trusted_daemon)
Definition: wallet2.cpp:3043
void set_tx_note(const crypto::hash &txid, const std::string &note)
Definition: wallet2.cpp:11777
std::vector< size_t > select_available_outputs_from_histogram(uint64_t count, bool atleast, bool unlocked, bool allow_rct)
Definition: wallet2.cpp:10582
void set_default_priority(uint32_t p)
Definition: wallet2.h:1066
bool invoke_http_bin(const boost::string_ref uri, const t_request &req, t_response &res, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET")
Definition: wallet2.h:1318
void set_tx_device_aux(const crypto::hash &txid, const std::string &aux)
Definition: wallet2.cpp:11790
void enable_dns(bool enable)
Definition: wallet2.h:1375
void freeze(size_t idx)
Definition: wallet2.cpp:1583
const std::string & device_derivation_path() const
Definition: wallet2.h:1103
void callback(i_wallet2_callback *callback)
Definition: wallet2.h:757
static bool parse_payment_id(const std::string &payment_id_str, crypto::hash &payment_id)
Definition: wallet2.cpp:5628
bool load_multisig_tx_from_file(const std::string &filename, multisig_tx_set &exported_txs, std::function< bool(const multisig_tx_set &)> accept_func=NULL)
Definition: wallet2.cpp:7382
std::string make_uri(const std::string &address, const std::string &payment_id, uint64_t amount, const std::string &tx_description, const std::string &recipient_name, std::string &error) const
Definition: wallet2.cpp:13035
void merge_destinations(bool merge)
Definition: wallet2.h:1077
void store_to(const std::string &path, const epee::wipeable_string &password)
store_to Stores wallet to another file(s), deleting old ones
Definition: wallet2.cpp:5928
void set_tx_notify(const std::shared_ptr< tools::Notify > &notify)
Definition: wallet2.h:1369
wallet2(cryptonote::network_type nettype=cryptonote::MAINNET, uint64_t kdf_rounds=1, bool unattended=false)
Definition: wallet2.cpp:1101
i_wallet2_callback * callback() const
Definition: wallet2.h:756
void remove_obsolete_pool_txs(const std::vector< crypto::hash > &tx_hashes)
Definition: wallet2.cpp:3119
std::pair< size_t, size_t > get_subaddress_lookahead() const
Definition: wallet2.h:802
std::vector< size_t > select_available_outputs(const std::function< bool(const transfer_details &td)> &f) const
Definition: wallet2.cpp:10545
const transfer_details & get_transfer_details(size_t idx) const
Definition: wallet2.cpp:10642
bool set_blackballed_outputs(const std::vector< std::pair< uint64_t, uint64_t >> &outputs, bool add=false)
Definition: wallet2.cpp:7973
std::vector< std::pair< uint64_t, uint64_t > > estimate_backlog(const std::vector< std::pair< double, double >> &fee_levels)
Definition: wallet2.cpp:13269
uint64_t get_daemon_blockchain_height(std::string &err) const
Definition: wallet2.cpp:11721
uint64_t get_min_output_value() const
Definition: wallet2.h:1076
std::vector< pending_tx > create_unmixable_sweep_transactions()
Definition: wallet2.cpp:10660
crypto::public_key get_tx_pub_key_from_received_outs(const tools::wallet2::transfer_details &td) const
Definition: wallet2.cpp:11933
bool delete_address_book_row(std::size_t row_id)
Definition: wallet2.cpp:3449
void check_tx_key_helper(const crypto::hash &txid, const crypto::key_derivation &derivation, const std::vector< crypto::key_derivation > &additional_derivations, const cryptonote::account_public_address &address, uint64_t &received, bool &in_pool, uint64_t &confirmations)
Definition: wallet2.cpp:11113
void explicit_refresh_from_block_height(bool expl)
Definition: wallet2.h:739
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)
Definition: wallet2.cpp:7120
uint64_t segregation_height() const
Definition: wallet2.h:1091
void add_subaddress(uint32_t index_major, const std::string &label)
Definition: wallet2.cpp:1469
bool ignore_fractional_outputs() const
Definition: wallet2.h:1093
bool check_connection(uint32_t *version=NULL, bool *ssl=NULL, uint32_t timeout=200000)
Definition: wallet2.cpp:5648
void decrypt_keys(const crypto::chacha_key &key)
Definition: wallet2.cpp:4642
bool is_synced() const
Definition: wallet2.cpp:13260
bool light_wallet_import_wallet_request(tools::COMMAND_RPC_IMPORT_WALLET_REQUEST::response &response)
Definition: wallet2.cpp:9059
void update_pool_state(bool refreshed=false)
Definition: wallet2.cpp:3147
void ask_password(AskPasswordType ask)
Definition: wallet2.h:1072
std::string get_daemon_address() const
Definition: wallet2.cpp:11716
BackgroundMiningSetupType setup_background_mining() const
Definition: wallet2.h:1099
void confirm_missing_payment_id(bool always)
Definition: wallet2.h:1070
static std::string device_derivation_path_option(const boost::program_options::variables_map &vm)
Definition: wallet2.cpp:1187
bool get_seed(epee::wipeable_string &electrum_words, const epee::wipeable_string &passphrase=epee::wipeable_string()) const
Definition: wallet2.cpp:1300
std::pair< size_t, std::vector< tools::wallet2::transfer_details > > export_outputs(bool all=false) const
Definition: wallet2.cpp:12503
std::vector< size_t > select_available_mixable_outputs()
Definition: wallet2.cpp:10654
std::tuple< uint64_t, crypto::public_key, rct::key > get_outs_entry
Definition: wallet2.h:556
void restore(const std::string &wallet_, const epee::wipeable_string &password, const std::string &device_name, bool create_address_file=false)
Restore a wallet hold by an HW.
Definition: wallet2.cpp:5000
std::string sign(const std::string &data) const
Definition: wallet2.cpp:11866
size_t get_num_subaddress_accounts() const
Definition: wallet2.h:795
bool light_wallet_parse_rct_str(const std::string &rct_string, const crypto::public_key &tx_pub_key, uint64_t internal_output_index, rct::key &decrypted_mask, rct::key &rct_commit, bool decrypt) const
Definition: wallet2.cpp:9432
bool load_multisig_tx(cryptonote::blobdata blob, multisig_tx_set &exported_txs, std::function< bool(const multisig_tx_set &)> accept_func=NULL)
Definition: wallet2.cpp:7348
void light_wallet_get_unspent_outs()
Definition: wallet2.cpp:9074
bool parse_tx_from_str(const std::string &signed_tx_st, std::vector< tools::wallet2::pending_tx > &ptx, std::function< bool(const signed_tx_set &)> accept_func)
Definition: wallet2.cpp:7141
static bool query_device(hw::device::device_type &device_type, const std::string &keys_file_name, const epee::wipeable_string &password, uint64_t kdf_rounds=1)
determine the key storage for the specified wallet file
Definition: wallet2.cpp:4697
std::map< uint32_t, uint64_t > balance_per_subaddress(uint32_t subaddr_index_major, bool public_blockchain=false) const
Definition: wallet2.cpp:6078
std::string get_attribute(const std::string &key) const
Definition: wallet2.cpp:11808
bool is_keys_file_locked() const
Definition: wallet2.cpp:8026
size_t import_outputs(const std::pair< size_t, std::vector< tools::wallet2::transfer_details >> &outputs)
Definition: wallet2.cpp:12543
void device_name(const std::string &device_name)
Definition: wallet2.h:1102
void add_subaddress_account(const std::string &label, const bool update_account_tags=true)
Definition: wallet2.cpp:1462
void hash_m_transfer(const transfer_details &transfer, crypto::hash &hash) const
Definition: wallet2.cpp:13479
bool confirm_backlog() const
Definition: wallet2.h:1079
bool sign_multisig_tx(multisig_tx_set &exported_txs, std::vector< crypto::hash > &txids)
Definition: wallet2.cpp:7406
void cold_sign_tx(const std::vector< pending_tx > &ptx_vector, signed_tx_set &exported_txs, std::vector< cryptonote::address_parse_info > &dsts_info, std::vector< std::string > &tx_device_aux)
Definition: wallet2.cpp:10455
void set_description(const std::string &description)
Definition: wallet2.cpp:11816
@ AskPasswordToDecrypt
Definition: wallet2.h:228
@ AskPasswordOnAction
Definition: wallet2.h:227
@ AskPasswordNever
Definition: wallet2.h:226
void set_min_output_count(uint32_t count)
Definition: wallet2.h:1073
static std::pair< std::unique_ptr< wallet2 >, password_container > make_from_json(const boost::program_options::variables_map &vm, bool unattended, const std::string &json_file, const std::function< boost::optional< password_container >(const char *, bool)> &password_prompter)
Uses stdin and stdout. Returns a wallet2 if no errors.
Definition: wallet2.cpp:1226
std::string get_subaddress_label(const cryptonote::subaddress_index &index) const
Definition: wallet2.cpp:1517
void setup_background_mining(BackgroundMiningSetupType value)
Definition: wallet2.h:1100
bool verify(const std::string &data, const cryptonote::account_public_address &address, const std::string &signature) const
Definition: wallet2.cpp:11876
bool confirm_non_default_ring_size() const
Definition: wallet2.h:1095
void transfer_selected(const std::vector< cryptonote::tx_destination_entry > &dsts, const std::vector< 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)
Definition: wallet2.cpp:8742
static std::string device_name_option(const boost::program_options::variables_map &vm)
Definition: wallet2.cpp:1182
uint64_t get_bytes_sent() const
Definition: wallet2.cpp:13536
void set_subaddress_label(const cryptonote::subaddress_index &index, const std::string &label)
Definition: wallet2.cpp:1527
void set_light_wallet(bool light_wallet)
Definition: wallet2.h:772
std::vector< wallet2::pending_tx > create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector< uint8_t > &extra, uint32_t subaddr_account, std::set< uint32_t > subaddr_indices, const bool migrate=false)
Definition: wallet2.cpp:10149
size_t get_num_transfer_details() const
Definition: wallet2.h:1147
std::vector< address_book_row > get_address_book() const
GUI Address book get/store.
Definition: wallet2.h:1142
const mms::message_store & get_message_store() const
Definition: wallet2.h:1360
uint64_t get_min_ring_size() const
Definition: wallet2.cpp:7629
void light_wallet_get_outs(std::vector< std::vector< get_outs_entry >> &outs, const std::vector< size_t > &selected_transfers, size_t fake_outputs_count)
Definition: wallet2.cpp:8058
uint64_t get_fee_multiplier(uint32_t priority, int fee_algorithm=-1) const
Definition: wallet2.cpp:7531
int get_fee_algorithm() const
Definition: wallet2.cpp:7617
void set_refresh_from_block_height(uint64_t height)
Definition: wallet2.h:736
void get_unconfirmed_payments_out(std::list< std::pair< crypto::hash, wallet2::unconfirmed_transfer_details >> &unconfirmed_payments, const boost::optional< uint32_t > &subaddr_account=boost::none, const std::set< uint32_t > &subaddr_indices={}) const
Definition: wallet2.cpp:6267
bool print_ring_members() const
Definition: wallet2.h:1059
bool init(std::string daemon_address="http://localhost:8080", boost::optional< epee::net_utils::http::login > daemon_login=boost::none, boost::asio::ip::tcp::endpoint proxy={}, uint64_t upper_transaction_weight_limit=0, bool trusted_daemon=true, epee::net_utils::ssl_options_t ssl_options=epee::net_utils::ssl_support_t::e_ssl_support_autodetect, std::string blockchain_db_path="")
Definition: wallet2.cpp:1281
uint32_t account_major_offset() const
Definition: wallet2.h:805
void get_payments(const crypto::hash &payment_id, std::list< wallet2::payment_details > &payments, uint64_t min_height=0, const boost::optional< uint32_t > &subaddr_account=boost::none, const std::set< uint32_t > &subaddr_indices={}) const
Definition: wallet2.cpp:6210
payment_container export_payments() const
Definition: wallet2.cpp:12445
bool use_fork_rules(uint8_t version, int64_t early_blocks=0) const
Definition: wallet2.cpp:10510
bool reconnect_device()
Definition: wallet2.cpp:1389
void thaw(size_t idx)
Definition: wallet2.cpp:1590
bool has_multisig_partial_key_images() const
Definition: wallet2.cpp:5537
void get_transfers(wallet2::transfer_container &incoming_transfers) const
Definition: wallet2.cpp:6205
std::string get_tx_device_aux(const crypto::hash &txid) const
Definition: wallet2.cpp:11795
AskPasswordType ask_password() const
Definition: wallet2.h:1071
bool light_wallet_get_address_info(tools::COMMAND_RPC_GET_ADDRESS_INFO::response &response)
Definition: wallet2.cpp:9228
uint64_t get_blockchain_height_by_date(uint16_t year, uint8_t month, uint8_t day)
Definition: wallet2.cpp:13173
static bool verify_multisig_info(const std::string &data, crypto::secret_key &skey, crypto::public_key &pkey)
Definition: wallet2.cpp:5438
uint64_t hash_m_transfers(int64_t transfer_height, crypto::hash &hash) const
Definition: wallet2.cpp:13490
void device_derivation_path(const std::string &device_derivation_path)
Definition: wallet2.h:1104
std::vector< transfer_details > transfer_container
Definition: wallet2.h:443
size_t import_outputs_from_str(const std::string &outputs_st)
Definition: wallet2.cpp:12608
void confirm_non_default_ring_size(bool always)
Definition: wallet2.h:1096
void change_password(const std::string &filename, const epee::wipeable_string &original_password, const epee::wipeable_string &new_password)
Definition: wallet2.cpp:4210
bool always_confirm_transfers() const
Definition: wallet2.h:1057
std::string sign_multisig_participant(const std::string &data) const
sign_multisig_participant signs given message with the multisig public signer key
Definition: wallet2.cpp:11899
uint64_t get_light_wallet_blockchain_height() const
Definition: wallet2.h:774
static std::string get_human_readable_timestamp(uint64_t ts)
Check if wallet file path is valid format.
Definition: wallet2.h:1031
bool track_uses() const
Definition: wallet2.h:1097
void check_tx_key(const crypto::hash &txid, const crypto::secret_key &tx_key, const std::vector< crypto::secret_key > &additional_tx_keys, const cryptonote::account_public_address &address, uint64_t &received, bool &in_pool, uint64_t &confirmations)
Definition: wallet2.cpp:11066
bool set_ring(const crypto::key_image &key_image, const std::vector< uint64_t > &outs, bool relative)
Definition: wallet2.cpp:7853
std::string make_multisig(const epee::wipeable_string &password, const std::vector< std::string > &info, uint32_t threshold)
Creates a multisig wallet.
Definition: wallet2.cpp:5356
void import_payments_out(const std::list< std::pair< crypto::hash, wallet2::confirmed_transfer_details >> &confirmed_payments)
Definition: wallet2.cpp:12462
bool lock_keys_file()
Definition: wallet2.cpp:8004
uint64_t get_last_block_reward() const
Definition: wallet2.h:898
@ RefreshOptimizeCoinbase
Definition: wallet2.h:220
@ RefreshNoCoinbase
Definition: wallet2.h:221
const std::string & device_name() const
Definition: wallet2.h:1101
void set_seed_language(const std::string &language)
Sets the seed language.
Definition: wallet2.cpp:1424
void confirm_backlog(bool always)
Definition: wallet2.h:1080
void stop()
Definition: wallet2.h:754
void set_refresh_type(RefreshType refresh_type)
Definition: wallet2.h:815
static std::unique_ptr< wallet2 > make_dummy(const boost::program_options::variables_map &vm, bool unattended, const std::function< boost::optional< password_container >(const char *, bool)> &password_prompter)
Just parses variables.
Definition: wallet2.cpp:1260
const char *const ATTRIBUTE_DESCRIPTION
Definition: wallet2.h:1301
std::string get_description() const
Definition: wallet2.cpp:11821
const std::string get_ring_database() const
Definition: wallet2.h:1333
uint64_t get_bytes_received() const
Definition: wallet2.cpp:13541
void set_attribute(const std::string &key, const std::string &value)
Definition: wallet2.cpp:11803
void import_payments(const payment_container &payments)
Definition: wallet2.cpp:12454
bool key_reuse_mitigation2() const
Definition: wallet2.h:1089
bool unblackball_output(const std::pair< uint64_t, uint64_t > &output)
Definition: wallet2.cpp:7988
void encrypt_keys(const crypto::chacha_key &key)
Definition: wallet2.cpp:4636
bool get_ring(const crypto::key_image &key_image, std::vector< uint64_t > &outs)
Definition: wallet2.cpp:7847
const std::pair< std::map< std::string, std::string >, std::vector< std::string > > & get_account_tags()
Get the list of registered account tags.
Definition: wallet2.cpp:11826
bool sign_tx(const std::string &unsigned_filename, const std::string &signed_filename, std::vector< wallet2::pending_tx > &ptx, std::function< bool(const unsigned_tx_set &)> accept_func=NULL, bool export_raw=false)
Definition: wallet2.cpp:6901
void auto_low_priority(bool value)
Definition: wallet2.h:1086
mms::multisig_wallet_state get_multisig_wallet_state() const
Definition: wallet2.cpp:13395
uint64_t get_daemon_blockchain_target_height(std::string &err)
Definition: wallet2.cpp:11739
static std::pair< std::unique_ptr< wallet2 >, password_container > make_from_file(const boost::program_options::variables_map &vm, bool unattended, const std::string &wallet_file, const std::function< boost::optional< password_container >(const char *, bool)> &password_prompter)
Uses stdin and stdout. Returns a wallet2 and password for wallet_file if no errors.
Definition: wallet2.cpp:1232
uint32_t get_default_priority() const
Definition: wallet2.h:1065
uint64_t get_device_last_key_image_sync() const
Definition: wallet2.h:899
crypto::public_key get_multisig_signer_public_key() const
Definition: wallet2.cpp:12678
uint32_t get_min_output_count() const
Definition: wallet2.h:1074
void set_subaddress_lookahead(size_t major, size_t minor)
Definition: wallet2.cpp:1534
uint64_t get_fee_quantization_mask() const
Definition: wallet2.cpp:7600
boost::optional< cryptonote::subaddress_index > get_subaddress_index(const cryptonote::account_public_address &address) const
Definition: wallet2.cpp:1436
bool check_tx_proof(const crypto::hash &txid, const cryptonote::account_public_address &address, bool is_subaddress, const std::string &message, const std::string &sig_str, uint64_t &received, bool &in_pool, uint64_t &confirmations)
Definition: wallet2.cpp:11317
bool finalize_multisig(const epee::wipeable_string &password, const std::vector< std::string > &info)
Finalizes creation of a multisig wallet.
Definition: wallet2.cpp:5406
std::vector< crypto::public_key > get_subaddress_spend_public_keys(uint32_t account, uint32_t begin, uint32_t end) const
std::string get_integrated_address_as_str(const crypto::hash8 &payment_id) const
Definition: wallet2.cpp:1457
bool save_tx(const std::vector< pending_tx > &ptx_vector, const std::string &filename) const
Definition: wallet2.cpp:6774
std::string decrypt_with_view_secret_key(const std::string &ciphertext, bool authenticated=true) const
Definition: wallet2.cpp:13030
std::string get_spend_proof(const crypto::hash &txid, const std::string &message)
Definition: wallet2.cpp:10837
void set_account_tag(const std::set< uint32_t > &account_indices, const std::string &tag)
Set a tag to the given accounts.
Definition: wallet2.cpp:11846
size_t get_num_subaddresses(uint32_t index_major) const
Definition: wallet2.h:796
void get_payments_out_migration(std::list< std::pair< crypto::hash, wallet2::confirmed_transfer_details >> &confirmed_payments, uint64_t min_height, uint64_t max_height=(uint64_t) -1, const boost::optional< uint32_t > &subaddr_account=boost::none, const std::set< uint32_t > &subaddr_indices={}) const
Definition: wallet2.cpp:6251
uint64_t get_blockchain_current_height() const
Definition: wallet2.h:890
void set_account_tag_description(const std::string &tag, const std::string &description)
Set the label of the given tag.
Definition: wallet2.cpp:11859
std::string get_wallet_file() const
Definition: wallet2.cpp:11706
bool is_deterministic() const
Checks if deterministic wallet.
Definition: wallet2.cpp:1292
static bool parse_long_payment_id(const std::string &payment_id_str, crypto::hash &payment_id)
Definition: wallet2.cpp:5602
bool store_tx_info() const
Definition: wallet2.h:1061
void serialize(t_archive &a, const unsigned int ver)
Definition: wallet2.h:902
void get_unconfirmed_payments(std::list< std::pair< crypto::hash, wallet2::pool_payment_details >> &unconfirmed_payments, const boost::optional< uint32_t > &subaddr_account=boost::none, const std::set< uint32_t > &subaddr_indices={}) const
Definition: wallet2.cpp:6278
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)
Definition: wallet2.cpp:13089
std::vector< size_t > select_available_unmixable_outputs()
Definition: wallet2.cpp:10648
bool blackball_output(const std::pair< uint64_t, uint64_t > &output)
Definition: wallet2.cpp:7965
bool sign_multisig_tx_from_file(const std::string &filename, std::vector< crypto::hash > &txids, std::function< bool(const multisig_tx_set &)> accept_func)
Definition: wallet2.cpp:7517
bool multisig(bool *ready=NULL, uint32_t *threshold=NULL, uint32_t *total=NULL) const
Definition: wallet2.cpp:5524
uint64_t unlocked_balance(uint32_t subaddr_index_major, bool public_blockchain, uint64_t *blocks_to_unlock=NULL) const
Definition: wallet2.cpp:6062
std::vector< wallet2::pending_tx > create_transactions_from(const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, std::vector< size_t > unused_transfers_indices, std::vector< size_t > unused_dust_indices, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector< uint8_t > &extra, const uint8_t tx_version)
Definition: wallet2.cpp:10229
RefreshType get_refresh_type() const
Definition: wallet2.h:816
bool verify_with_public_key(const std::string &data, const crypto::public_key &public_key, const std::string &signature) const
verify_with_public_key verifies message was signed with given public key
Definition: wallet2.cpp:11911
uint32_t adjust_priority(uint32_t priority)
Definition: wallet2.cpp:7670
std::string save_multisig_tx(multisig_tx_set txs)
Definition: wallet2.cpp:7230
T decrypt(const std::string &ciphertext, const crypto::secret_key &skey, bool authenticated=true) const
Definition: wallet2.cpp:13003
void generate(const std::string &wallet_, const epee::wipeable_string &password, const epee::wipeable_string &multisig_data, bool create_address_file=false)
Generates a wallet or restores one.
Definition: wallet2.cpp:4759
bool has_unknown_key_images() const
Definition: wallet2.cpp:5547
static bool parse_short_payment_id(const std::string &payment_id_str, crypto::hash8 &payment_id)
Definition: wallet2.cpp:5615
uint64_t get_refresh_from_block_height() const
Definition: wallet2.h:737
BackgroundMiningSetupType
Definition: wallet2.h:231
@ BackgroundMiningNo
Definition: wallet2.h:234
@ BackgroundMiningMaybe
Definition: wallet2.h:232
@ BackgroundMiningYes
Definition: wallet2.h:233
bool check_reserve_proof(const cryptonote::account_public_address &address, const std::string &message, const std::string &sig_str, uint64_t &total, uint64_t &spent)
Verifies a proof of reserve.
Definition: wallet2.cpp:11580
bool key_on_device() const
Definition: wallet2.h:824
std::tuple< size_t, crypto::hash, std::vector< crypto::hash > > export_blockchain() const
Definition: wallet2.cpp:12471
cryptonote::account_public_address get_subaddress(const cryptonote::subaddress_index &index) const
Definition: wallet2.cpp:1429
bool confirm_missing_payment_id() const
Definition: wallet2.h:1069
void set_tx_key(const crypto::hash &txid, const crypto::secret_key &tx_key, const std::vector< crypto::secret_key > &additional_tx_keys)
Definition: wallet2.cpp:10790
void confirm_export_overwrite(bool always)
Definition: wallet2.h:1084
void get_hard_fork_info(uint8_t version, uint64_t &earliest_height) const
Definition: wallet2.cpp:10504
bool check_spend_proof(const crypto::hash &txid, const std::string &message, const std::string &sig_str)
Definition: wallet2.cpp:10953
multisig_tx_set make_multisig_tx_set(const std::vector< pending_tx > &ptx_vector) const
Definition: wallet2.cpp:7276
bool is_output_blackballed(const std::pair< uint64_t, uint64_t > &output) const
Definition: wallet2.cpp:7996
void rewrite(const std::string &wallet_name, const epee::wipeable_string &password)
Rewrites to the wallet file for wallet upgrade (doesn't generate key, assumes it's already there)
Definition: wallet2.cpp:5560
bool light_wallet_key_image_is_ours(const crypto::key_image &key_image, const crypto::public_key &tx_public_key, uint64_t out_index)
Definition: wallet2.cpp:9457
bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key, std::vector< crypto::secret_key > &additional_tx_keys)
Definition: wallet2.cpp:10714
bool auto_refresh() const
Definition: wallet2.h:1067
static bool has_stagenet_option(const boost::program_options::variables_map &vm)
Definition: wallet2.cpp:1177
bool get_rings(const crypto::hash &txid, std::vector< std::pair< crypto::key_image, std::vector< uint64_t >>> &outs)
Definition: wallet2.cpp:7824
size_t pop_best_value_from(const transfer_container &transfers, std::vector< size_t > &unused_dust_indices, const std::vector< size_t > &selected_transfers, bool smallest=false) const
Definition: wallet2.cpp:6490
bool is_trusted_daemon() const
Definition: wallet2.h:759
void segregation_height(uint64_t height)
Definition: wallet2.h:1092
void import_blockchain(const std::tuple< size_t, crypto::hash, std::vector< crypto::hash >> &bc)
Definition: wallet2.cpp:12483
bool unset_ring(const std::vector< crypto::key_image > &key_images)
Definition: wallet2.cpp:7862
uint64_t get_approximate_blockchain_height() const
Calculates the approximate blockchain height from current date/time.
Definition: wallet2.cpp:11755
std::map< uint32_t, std::pair< uint64_t, uint64_t > > unlocked_balance_per_subaddress(uint32_t subaddr_index_major, bool public_blockchain=false) const
Definition: wallet2.cpp:6139
bool explicit_refresh_from_block_height() const
Definition: wallet2.h:740
bool set_ring_database(const std::string &filename)
Definition: wallet2.cpp:7746
bool confirm_export_overwrite() const
Definition: wallet2.h:1083
bool get_tx_key_cached(const crypto::hash &txid, crypto::secret_key &tx_key, std::vector< crypto::secret_key > &additional_tx_keys) const
Definition: wallet2.cpp:10701
std::string get_subaddress_as_str(const cryptonote::subaddress_index &index) const
Definition: wallet2.cpp:1451
std::string get_reserve_proof(const boost::optional< std::pair< uint32_t, uint64_t >> &account_minreserve, const std::string &message)
Generates a proof that proves the reserve of unspent funds.
Definition: wallet2.cpp:11459
void segregate_pre_fork_outputs(bool value)
Definition: wallet2.h:1088
void store_tx_info(bool store)
Definition: wallet2.h:1062
const std::string & get_seed_language() const
Gets the seed language.
Definition: wallet2.cpp:1416
hw::device::device_type get_device_type() const
Definition: wallet2.h:825
bool export_key_images(const std::string &filename) const
Definition: wallet2.cpp:11981
void set_confirm_backlog_threshold(uint32_t threshold)
Definition: wallet2.h:1081
void write_watch_only_wallet(const std::string &wallet_name, const epee::wipeable_string &password, std::string &new_keys_filename)
Writes to a file named based on the normal wallet (doesn't generate key, assumes it's already there)
Definition: wallet2.cpp:5576
static bool verify_extra_multisig_info(const std::string &data, std::unordered_set< crypto::public_key > &pkeys, crypto::public_key &signer)
Definition: wallet2.cpp:5476
std::string dump_tx_to_str(const std::vector< pending_tx > &ptx_vector) const
Definition: wallet2.cpp:6783
bool light_wallet_login(bool &new_address)
Definition: wallet2.cpp:9030
std::string encrypt_with_view_secret_key(const std::string &plaintext, bool authenticated=true) const
Definition: wallet2.cpp:12997
bool auto_low_priority() const
Definition: wallet2.h:1085
bool parse_multisig_tx_from_str(std::string multisig_tx_st, multisig_tx_set &exported_txs) const
Definition: wallet2.cpp:7304
bool find_and_save_rings(bool force=true)
Definition: wallet2.cpp:7899
uint64_t unlocked_balance_all(bool public_blockchain, uint64_t *blocks_to_unlock=NULL) const
Definition: wallet2.cpp:6190
uint64_t import_key_images(const std::vector< std::pair< crypto::key_image, crypto::signature >> &signed_key_images, size_t offset, uint64_t &spent, uint64_t &unspent, bool check_spent=true)
Definition: wallet2.cpp:12123
bool public_transactions_required() const
Definition: wallet2.h:892
std::unordered_multimap< crypto::hash, payment_details > payment_container
Definition: wallet2.h:444
bool synced_to_v10() const
Definition: wallet2.h:891
static bool wallet_valid_path_format(const std::string &file_path)
Definition: wallet2.cpp:5597
bool frozen(size_t idx) const
Definition: wallet2.cpp:1597
cryptonote::account_base & get_account()
Definition: wallet2.h:728
bool is_transfer_unlocked(const transfer_details &td) const
Definition: wallet2.cpp:6364
void cold_tx_aux_import(const std::vector< pending_tx > &ptx, const std::vector< std::string > &tx_device_aux)
Definition: wallet2.cpp:10445
uint64_t adjust_mixin(uint64_t mixin) const
Definition: wallet2.cpp:7653
static constexpr const std::chrono::seconds rpc_timeout
Definition: wallet2.h:216
uint64_t balance(uint32_t subaddr_index_major, bool public_blockchain) const
Definition: wallet2.cpp:6052
void commit_tx(pending_tx &ptx_vector)
Definition: wallet2.cpp:6686
static void init_options(boost::program_options::options_description &desc_params)
Definition: wallet2.cpp:1192
void account_major_offset(uint32_t offset)
Definition: wallet2.h:804
void print_ring_members(bool value)
Definition: wallet2.h:1060
mms::message_store & get_message_store()
Definition: wallet2.h:1359
bool is_deprecated() const
Tells if the wallet file is deprecated.
Definition: wallet2.cpp:1545
std::string get_address_as_str() const
Definition: wallet2.h:792
const cryptonote::account_base & get_account() const
Definition: wallet2.h:729
std::string get_tx_proof(const crypto::hash &txid, const cryptonote::account_public_address &address, bool is_subaddress, const std::string &message)
Definition: wallet2.cpp:11161
std::string sign_tx_dump_to_str(unsigned_tx_set &exported_txs, std::vector< wallet2::pending_tx > &ptx, signed_tx_set &signed_txes)
Definition: wallet2.cpp:7094
void discard_unmixable_outputs()
Definition: wallet2.cpp:10691
uint32_t default_mixin() const
Definition: wallet2.h:1063
void finish_rescan_bc_keep_key_images(uint64_t transfer_height, const crypto::hash &hash)
Definition: wallet2.cpp:13514
std::string get_tx_note(const crypto::hash &txid) const
Definition: wallet2.cpp:11782
uint64_t get_light_wallet_scanned_block_height() const
Definition: wallet2.h:773
void set_min_output_value(uint64_t value)
Definition: wallet2.h:1075
std::string get_keys_file() const
Definition: wallet2.cpp:11711
std::string path() const
Definition: wallet2.cpp:5917
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.
Definition: wallet2.cpp:5587
cryptonote::network_type nettype() const
Definition: wallet2.h:818
size_t pop_best_value(std::vector< size_t > &unused_dust_indices, const std::vector< size_t > &selected_transfers, bool smallest=false) const
Definition: wallet2.cpp:6539
void rescan_spent()
Definition: wallet2.cpp:6287
bool light_wallet() const
Checks if light wallet. A light wallet sends view key to a server where the blockchain is scanned.
Definition: wallet2.h:771
uint64_t estimate_blockchain_height()
Definition: wallet2.cpp:4880
bool invoke_http_json_rpc(const boost::string_ref uri, const std::string &method_name, const t_request &req, t_response &res, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
Definition: wallet2.h:1325
cryptonote::account_public_address get_address() const
Definition: wallet2.h:787
bool import_key_images(std::vector< crypto::key_image > key_images, size_t offset=0, boost::optional< std::unordered_set< size_t >> selected_transfers=boost::none)
crypto::public_key get_subaddress_spend_public_key(const cryptonote::subaddress_index &index) const
Definition: wallet2.cpp:1444
std::string get_multisig_info() const
Definition: wallet2.cpp:5419
void ignore_fractional_outputs(bool value)
Definition: wallet2.h:1094
const boost::optional< epee::net_utils::http::login > & get_daemon_login() const
Definition: wallet2.h:1157
static bool verify_password(const std::string &keys_file_name, const epee::wipeable_string &password, bool no_spend_key, hw::device &hwdev, uint64_t kdf_rounds)
verify password for specified wallet keys file.
Definition: wallet2.cpp:4589
void set_offline(bool offline=true)
Definition: wallet2.cpp:5700
boost::optional< epee::wipeable_string > on_passphrase_request(bool on_device) override
Definition: wallet2.cpp:1088
void on_button_pressed() override
Definition: wallet2.cpp:1075
void on_button_request(uint64_t code=0) override
Definition: wallet2.cpp:1069
wallet_device_callback(wallet2 *wallet)
Definition: wallet2.h:152
void on_progress(const hw::device_progress &event) override
Definition: wallet2.cpp:1095
boost::optional< epee::wipeable_string > on_pin_request() override
Definition: wallet2.cpp:1081
wallet_keys_unlocker(wallet2 &w, const boost::optional< tools::password_container > &password)
Definition: wallet2.cpp:1033
BOOST_CLASS_VERSION(nodetool::node_server< cryptonote::t_cryptonote_protocol_handler< tests::proxy_core > >, 1)
#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
#define FEE_PER_KB
std::string message("Message requiring signing")
const uint32_t T[512]
const char * res
Definition: hmac_keccak.cpp:41
const char * key
Definition: hmac_keccak.cpp:39
#define LOG_PRINT_L0(x)
Definition: misc_log_ex.h:99
std::enable_if< Archive::is_loading::value, void >::type initialize_transfer_details(Archive &a, tools::wallet2::transfer_details &x, const boost::serialization::version_type ver)
Definition: wallet2.h:1640
crypto namespace.
Definition: crypto.cpp:58
POD_CLASS signature
Definition: crypto.h:108
POD_CLASS hash8
Definition: hash.h:53
POD_CLASS key_derivation
Definition: crypto.h:98
POD_CLASS public_key
Definition: crypto.h:76
POD_CLASS key_image
Definition: crypto.h:102
POD_CLASS hash
Definition: hash.h:50
void decompose_amount_into_digits(uint64_t amount, uint64_t dust_threshold, const chunk_handler_t &chunk_handler, const dust_handler_t &dust_handler)
crypto::hash get_transaction_hash(const transaction &t)
std::string blobdata
Definition: blobdatatype.h:39
std::string print_etn(uint64_t amount, unsigned int decimal_point)
epee::misc_utils::struct_init< response_t > response
declaration and default definition for the functions used the API
Definition: expect.cpp:34
bool invoke_http_json(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref method="GET")
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
bool invoke_http_bin(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref method="GET")
tools::wallet2::tx_construction_data tx_construction_data
Definition: protocol.hpp:156
mdb_size_t count(MDB_cursor *cur)
error
Tracks LMDB error codes.
Definition: error.h:45
version
Supported socks variants.
Definition: socks.h:58
@ RangeProofBorromean
Definition: rctTypes.h:235
@ RangeProofBulletproof
Definition: rctTypes.h:235
key identity()
Definition: rctOps.h:73
::std::string string
Definition: gtest-port.h:1097
void print_source_entry(const cryptonote::tx_source_entry &src)
Definition: wallet2.h:2126
void digit_split_strategy(const std::vector< cryptonote::tx_destination_entry > &dsts, const cryptonote::tx_destination_entry &change_dst, uint64_t dust_threshold, std::vector< cryptonote::tx_destination_entry > &splitted_dsts, std::vector< cryptonote::tx_destination_entry > &dust_dsts)
Definition: wallet2.h:2087
void null_split_strategy(const std::vector< cryptonote::tx_destination_entry > &dsts, const cryptonote::tx_destination_entry &change_dst, uint64_t dust_threshold, std::vector< cryptonote::tx_destination_entry > &splitted_dsts, std::vector< cryptonote::tx_destination_entry > &dust_dsts)
Definition: wallet2.h:2111
Various Tools.
Definition: tools.cpp:31
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
#define BEGIN_SERIALIZE_OBJECT()
begins the environment of the DSL \detailed for described the serialization of an object
#define FIELD(f)
tags the field with the variable name and then serializes it
#define END_SERIALIZE()
self-explanatory
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:91
#define false
Definition: stdbool.h:38
unsigned short uint16_t
Definition: stdint.h:125
signed __int64 int64_t
Definition: stdint.h:135
unsigned int uint32_t
Definition: stdint.h:126
unsigned char uint8_t
Definition: stdint.h:124
unsigned __int64 uint64_t
Definition: stdint.h:136
uint64_t amount
account_public_address addr
uint64_t amount
size_t real_output
std::vector< output_entry > outputs
std::pair< uint64_t, rct::ctkey > output_entry
size_t real_output_in_tx_index
crypto::public_key key
RangeProofType range_proof_type
Definition: rctTypes.h:237
cryptonote::account_public_address addr_for_dust
Definition: wallet2.h:166
tx_dust_policy(uint64_t a_dust_threshold=0, bool an_add_to_fee=true, cryptonote::account_public_address an_addr_for_dust=cryptonote::account_public_address())
Definition: wallet2.h:168
uint64_t dust_threshold
Definition: wallet2.h:164
cryptonote::account_public_address m_address
Definition: wallet2.h:540
crypto::chacha_iv iv
Definition: wallet2.h:528
std::vector< std::pair< crypto::key_image, std::vector< uint64_t > > > m_rings
Definition: wallet2.h:406
confirmed_transfer_details(const unconfirmed_transfer_details &utd, uint64_t height)
Definition: wallet2.h:410
std::set< uint32_t > m_subaddr_indices
Definition: wallet2.h:405
std::vector< cryptonote::tx_destination_entry > m_dests
Definition: wallet2.h:400
std::vector< boost::optional< cryptonote::subaddress_receive_info > > received
Definition: wallet2.h:571
crypto::public_key pkey
Definition: wallet2.h:569
crypto::key_derivation derivation
Definition: wallet2.h:570
crypto::chacha_iv iv
Definition: wallet2.h:517
crypto::public_key m_signer
Definition: wallet2.h:277
std::vector< crypto::key_image > m_partial_key_images
Definition: wallet2.h:279
std::vector< LR > m_LR
Definition: wallet2.h:278
std::unordered_set< crypto::public_key > ignore
Definition: wallet2.h:449
rct::multisig_out msout
Definition: wallet2.h:452
std::unordered_set< crypto::public_key > signing_keys
Definition: wallet2.h:451
std::unordered_set< rct::key > used_L
Definition: wallet2.h:450
std::unordered_set< crypto::public_key > m_signers
Definition: wallet2.h:507
std::vector< pending_tx > m_ptx
Definition: wallet2.h:506
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices o_indices
Definition: wallet2.h:563
cryptonote::block block
Definition: wallet2.h:561
std::vector< cryptonote::transaction > txes
Definition: wallet2.h:562
cryptonote::subaddress_index m_subaddr_index
Definition: wallet2.h:362
tx_construction_data construction_data
Definition: wallet2.h:471
std::vector< size_t > selected_transfers
Definition: wallet2.h:464
crypto::secret_key tx_key
Definition: wallet2.h:466
std::vector< cryptonote::tx_destination_entry > dests
Definition: wallet2.h:468
std::vector< multisig_sig > multisig_sigs
Definition: wallet2.h:469
cryptonote::transaction tx
Definition: wallet2.h:460
std::vector< crypto::secret_key > additional_tx_keys
Definition: wallet2.h:467
std::string key_images
Definition: wallet2.h:465
cryptonote::tx_destination_entry change_dts
Definition: wallet2.h:463
Definition: wallet2.h:547
crypto::public_key shared_secret
Definition: wallet2.h:550
crypto::signature key_image_sig
Definition: wallet2.h:553
crypto::signature shared_secret_sig
Definition: wallet2.h:552
uint64_t index_in_tx
Definition: wallet2.h:549
crypto::key_image key_image
Definition: wallet2.h:551
crypto::hash txid
Definition: wallet2.h:548
std::unordered_map< crypto::public_key, crypto::key_image > tx_key_images
Definition: wallet2.h:501
std::vector< crypto::key_image > key_images
Definition: wallet2.h:500
std::vector< pending_tx > ptx
Definition: wallet2.h:499
crypto::key_image m_key_image
Definition: wallet2.h:311
std::vector< std::pair< uint64_t, crypto::hash > > m_uses
Definition: wallet2.h:322
std::vector< multisig_info > m_multisig_info
Definition: wallet2.h:321
cryptonote::subaddress_index m_subaddr_index
Definition: wallet2.h:318
const crypto::public_key & get_public_key() const
Definition: wallet2.h:326
cryptonote::transaction_prefix m_tx
Definition: wallet2.h:304
std::vector< rct::key > m_multisig_k
Definition: wallet2.h:320
const std::pair< crypto::hash, size_t > get_chainstate_index() const
Definition: wallet2.h:327
std::vector< cryptonote::tx_extra_field > tx_extra_fields
Definition: wallet2.h:587
std::vector< is_out_data > primary
Definition: wallet2.h:583
std::vector< is_out_data > public_outs
Definition: wallet2.h:590
std::vector< is_out_data > additional
Definition: wallet2.h:584
std::vector< uint8_t > extra
Definition: wallet2.h:420
std::vector< cryptonote::tx_source_entry > sources
Definition: wallet2.h:416
std::vector< cryptonote::tx_destination_entry > splitted_dsts
Definition: wallet2.h:418
std::vector< cryptonote::tx_destination_entry > dests
Definition: wallet2.h:424
std::vector< size_t > selected_transfers
Definition: wallet2.h:419
std::set< uint32_t > subaddr_indices
Definition: wallet2.h:426
cryptonote::tx_destination_entry change_dts
Definition: wallet2.h:417
boost::optional< cryptonote::subaddress_receive_info > received
Definition: wallet2.h:296
cryptonote::keypair in_ephemeral
Definition: wallet2.h:290
crypto::key_image ki
Definition: wallet2.h:291
enum tools::wallet2::unconfirmed_transfer_details::@62 m_state
cryptonote::transaction_prefix m_tx
Definition: wallet2.h:380
std::vector< std::pair< crypto::key_image, std::vector< uint64_t > > > m_rings
Definition: wallet2.h:391
std::vector< cryptonote::tx_destination_entry > m_dests
Definition: wallet2.h:385
std::vector< tx_construction_data > txes
Definition: wallet2.h:493
std::pair< size_t, wallet2::transfer_container > transfers
Definition: wallet2.h:494
struct hash_func hashes[]
const char * address
Definition: multisig.cpp:37
const char * spendkey
Definition: multisig.cpp:38
string daemon_address
Definition: transfers.cpp:42