Monero
wallet_errors.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2020, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
31 #pragma once
32 
33 #include <stdexcept>
34 #include <system_error>
35 #include <string>
36 #include <vector>
37 
41 #include "include_base_utils.h"
42 
43 
44 namespace tools
45 {
46  namespace error
47  {
48  // std::exception
49  // std::runtime_error
50  // wallet_runtime_error *
51  // wallet_internal_error
52  // unexpected_txin_type
53  // wallet_not_initialized
54  // multisig_export_needed
55  // multisig_import_needed
56  // password_needed
57  // std::logic_error
58  // wallet_logic_error *
59  // file_exists
60  // file_not_found
61  // file_read_error
62  // file_save_error
63  // invalid_password
64  // invalid_priority
65  // invalid_multisig_seed
66  // refresh_error *
67  // acc_outs_lookup_error
68  // block_parse_error
69  // get_blocks_error
70  // get_hashes_error
71  // get_out_indexes_error
72  // tx_parse_error
73  // get_tx_pool_error
74  // out_of_hashchain_bounds_error
75  // signature_check_failed
76  // transfer_error *
77  // get_outs_general_error
78  // not_enough_unlocked_money
79  // not_enough_money
80  // tx_not_possible
81  // not_enough_outs_to_mix
82  // tx_not_constructed
83  // tx_rejected
84  // tx_sum_overflow
85  // tx_too_big
86  // zero_destination
87  // wallet_rpc_error *
88  // daemon_busy
89  // no_connection_to_daemon
90  // is_key_image_spent_error
91  // get_histogram_error
92  // get_output_distribution
93  // payment_required
94  // wallet_files_doesnt_correspond
95  //
96  // * - class with protected ctor
97 
98  //----------------------------------------------------------------------------------------------------
99  template<typename Base>
100  struct wallet_error_base : public Base
101  {
102  const std::string& location() const { return m_loc; }
103 
104  std::string to_string() const
105  {
106  std::ostringstream ss;
107  ss << m_loc << ':' << typeid(*this).name() << ": " << Base::what();
108  return ss.str();
109  }
110 
111  protected:
112  wallet_error_base(std::string&& loc, const std::string& message)
113  : Base(message)
114  , m_loc(loc)
115  {
116  }
117 
118  private:
119  std::string m_loc;
120  };
121  //----------------------------------------------------------------------------------------------------
122  const char* const failed_rpc_request_messages[] = {
123  "failed to get blocks",
124  "failed to get hashes",
125  "failed to get out indices",
126  "failed to get random outs"
127  };
129  {
134  };
135 
136  template<typename Base, int msg_index>
137  struct failed_rpc_request : public Base
138  {
139  explicit failed_rpc_request(std::string&& loc, const std::string& status)
140  : Base(std::move(loc), failed_rpc_request_messages[msg_index])
141  , m_status(status)
142  {
143  }
144 
145  const std::string& status() const { return m_status; }
146 
147  std::string to_string() const
148  {
149  std::ostringstream ss;
150  ss << Base::to_string() << ", status = " << status();
151  return ss.str();
152  }
153 
154  private:
155  std::string m_status;
156  };
157  //----------------------------------------------------------------------------------------------------
160  //----------------------------------------------------------------------------------------------------
162  {
163  explicit wallet_internal_error(std::string&& loc, const std::string& message)
164  : wallet_runtime_error(std::move(loc), message)
165  {
166  }
167  };
168  //----------------------------------------------------------------------------------------------------
170  {
171  explicit unexpected_txin_type(std::string&& loc, const cryptonote::transaction& tx)
172  : wallet_internal_error(std::move(loc), "one of tx inputs has unexpected type")
173  , m_tx(tx)
174  {
175  }
176 
177  const cryptonote::transaction& tx() const { return m_tx; }
178 
179  std::string to_string() const
180  {
181  std::ostringstream ss;
184  return ss.str();
185  }
186 
187  private:
189  };
190  //----------------------------------------------------------------------------------------------------
192  {
193  explicit wallet_not_initialized(std::string&& loc)
194  : wallet_internal_error(std::move(loc), "wallet is not initialized")
195  {
196  }
197  };
198  //----------------------------------------------------------------------------------------------------
200  {
201  explicit multisig_export_needed(std::string&& loc)
202  : wallet_runtime_error(std::move(loc), "This signature was made with stale data: export fresh multisig data, which other participants must then use")
203  {
204  }
205  };
206  //----------------------------------------------------------------------------------------------------
208  {
209  explicit multisig_import_needed(std::string&& loc)
210  : wallet_runtime_error(std::move(loc), "Not enough multisig data was found to sign: import multisig data from more other participants")
211  {
212  }
213  };
214  //----------------------------------------------------------------------------------------------------
216  {
217  explicit password_needed(std::string&& loc, const std::string &msg = "Password needed")
218  : wallet_runtime_error(std::move(loc), msg)
219  {
220  }
221  };
222  //----------------------------------------------------------------------------------------------------
224  {
225  explicit password_entry_failed(std::string&& loc, const std::string &msg = "Password entry failed")
226  : wallet_runtime_error(std::move(loc), msg)
227  {
228  }
229  };
230  //----------------------------------------------------------------------------------------------------
231  const char* const file_error_messages[] = {
232  "file already exists",
233  "file not found",
234  "failed to read file",
235  "failed to save file"
236  };
238  {
243  };
244 
245  template<int msg_index>
247  {
248  explicit file_error_base(std::string&& loc, const std::string& file)
249  : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + '\"')
250  , m_file(file)
251  {
252  }
253 
254  explicit file_error_base(std::string&& loc, const std::string& file, const std::error_code &e)
255  : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + "\": " + e.message())
256  , m_file(file)
257  {
258  }
259 
260  const std::string& file() const { return m_file; }
261 
262  std::string to_string() const { return wallet_logic_error::to_string(); }
263 
264  private:
265  std::string m_file;
266  };
267  //----------------------------------------------------------------------------------------------------
272  //----------------------------------------------------------------------------------------------------
274  {
275  explicit invalid_password(std::string&& loc)
276  : wallet_logic_error(std::move(loc), "invalid password")
277  {
278  }
279 
280  std::string to_string() const { return wallet_logic_error::to_string(); }
281  };
283  {
284  explicit invalid_priority(std::string&& loc)
285  : wallet_logic_error(std::move(loc), "invalid priority")
286  {
287  }
288 
289  std::string to_string() const { return wallet_logic_error::to_string(); }
290  };
291 
293  {
294  explicit invalid_multisig_seed(std::string&& loc)
295  : wallet_logic_error(std::move(loc), "invalid multisig seed")
296  {
297  }
298 
299  std::string to_string() const { return wallet_logic_error::to_string(); }
300  };
301 
302  //----------------------------------------------------------------------------------------------------
304  {
305  explicit invalid_pregenerated_random (std::string&& loc)
306  : wallet_logic_error(std::move(loc), "invalid pregenerated random for wallet creation/recovery")
307  {
308  }
309 
310  std::string to_string() const { return wallet_logic_error::to_string(); }
311  };
312  //----------------------------------------------------------------------------------------------------
314  {
315  protected:
316  explicit refresh_error(std::string&& loc, const std::string& message)
317  : wallet_logic_error(std::move(loc), message)
318  {
319  }
320  };
321  //----------------------------------------------------------------------------------------------------
323  {
324  explicit index_outofbound(std::string&& loc, const std::string& message)
325  : wallet_logic_error(std::move(loc), message)
326  {
327  }
328  };
330  {
331  explicit account_index_outofbound(std::string&& loc)
332  : index_outofbound(std::move(loc), "account index is out of bound")
333  {
334  }
335  };
337  {
338  explicit address_index_outofbound(std::string&& loc)
339  : index_outofbound(std::move(loc), "address index is out of bound")
340  {
341  }
342  };
343  //----------------------------------------------------------------------------------------------------
345  {
346  explicit acc_outs_lookup_error(std::string&& loc, const cryptonote::transaction& tx,
348  : refresh_error(std::move(loc), "account outs lookup error")
349  , m_tx(tx)
352  {
353  }
354 
355  const cryptonote::transaction& tx() const { return m_tx; }
356  const crypto::public_key& tx_pub_key() const { return m_tx_pub_key; }
357  const cryptonote::account_keys& acc_keys() const { return m_acc_keys; }
358 
359  std::string to_string() const
360  {
361  std::ostringstream ss;
364  return ss.str();
365  }
366 
367  private:
371  };
372  //----------------------------------------------------------------------------------------------------
374  {
375  explicit block_parse_error(std::string&& loc, const cryptonote::blobdata& block_data)
376  : refresh_error(std::move(loc), "block parse error")
377  , m_block_blob(block_data)
378  {
379  }
380 
381  const cryptonote::blobdata& block_blob() const { return m_block_blob; }
382 
383  std::string to_string() const { return refresh_error::to_string(); }
384 
385  private:
387  };
388  //----------------------------------------------------------------------------------------------------
390  //----------------------------------------------------------------------------------------------------
392  //----------------------------------------------------------------------------------------------------
394  //----------------------------------------------------------------------------------------------------
396  {
397  explicit tx_parse_error(std::string&& loc, const cryptonote::blobdata& tx_blob)
398  : refresh_error(std::move(loc), "transaction parse error")
399  , m_tx_blob(tx_blob)
400  {
401  }
402 
403  const cryptonote::blobdata& tx_blob() const { return m_tx_blob; }
404 
405  std::string to_string() const { return refresh_error::to_string(); }
406 
407  private:
409  };
410  //----------------------------------------------------------------------------------------------------
412  {
413  explicit get_tx_pool_error(std::string&& loc)
414  : refresh_error(std::move(loc), "error getting transaction pool")
415  {
416  }
417 
418  std::string to_string() const { return refresh_error::to_string(); }
419  };
420  //----------------------------------------------------------------------------------------------------
422  {
423  explicit out_of_hashchain_bounds_error(std::string&& loc)
424  : refresh_error(std::move(loc), "Index out of bounds of of hashchain")
425  {
426  }
427 
428  std::string to_string() const { return refresh_error::to_string(); }
429  };
430  //----------------------------------------------------------------------------------------------------
432  {
433  explicit signature_check_failed(std::string&& loc, const std::string& message)
434  : wallet_logic_error(std::move(loc), "Signature check failed " + message)
435  {
436  }
437  };
438  //----------------------------------------------------------------------------------------------------
440  {
441  protected:
442  explicit transfer_error(std::string&& loc, const std::string& message)
443  : wallet_logic_error(std::move(loc), message)
444  {
445  }
446  };
447  //----------------------------------------------------------------------------------------------------
449  //----------------------------------------------------------------------------------------------------
451  {
452  explicit not_enough_unlocked_money(std::string&& loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
453  : transfer_error(std::move(loc), "not enough unlocked money")
456  {
457  }
458 
459  uint64_t available() const { return m_available; }
460  uint64_t tx_amount() const { return m_tx_amount; }
461 
462  std::string to_string() const
463  {
464  std::ostringstream ss;
465  ss << transfer_error::to_string() <<
466  ", available = " << cryptonote::print_money(m_available) <<
467  ", tx_amount = " << cryptonote::print_money(m_tx_amount);
468  return ss.str();
469  }
470 
471  private:
472  uint64_t m_available;
473  uint64_t m_tx_amount;
474  };
475  //----------------------------------------------------------------------------------------------------
477  {
478  explicit not_enough_money(std::string&& loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
479  : transfer_error(std::move(loc), "not enough money")
482  {
483  }
484 
485  uint64_t available() const { return m_available; }
486  uint64_t tx_amount() const { return m_tx_amount; }
487 
488  std::string to_string() const
489  {
490  std::ostringstream ss;
491  ss << transfer_error::to_string() <<
492  ", available = " << cryptonote::print_money(m_available) <<
493  ", tx_amount = " << cryptonote::print_money(m_tx_amount);
494  return ss.str();
495  }
496 
497  private:
498  uint64_t m_available;
499  uint64_t m_tx_amount;
500  };
501  //----------------------------------------------------------------------------------------------------
503  {
504  explicit tx_not_possible(std::string&& loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
505  : transfer_error(std::move(loc), "tx not possible")
508  , m_fee(fee)
509  {
510  }
511 
512  uint64_t available() const { return m_available; }
513  uint64_t tx_amount() const { return m_tx_amount; }
514  uint64_t fee() const { return m_fee; }
515 
516  std::string to_string() const
517  {
518  std::ostringstream ss;
519  ss << transfer_error::to_string() <<
520  ", available = " << cryptonote::print_money(m_available) <<
521  ", tx_amount = " << cryptonote::print_money(m_tx_amount) <<
522  ", fee = " << cryptonote::print_money(m_fee);
523  return ss.str();
524  }
525 
526  private:
527  uint64_t m_available;
528  uint64_t m_tx_amount;
529  uint64_t m_fee;
530  };
531  //----------------------------------------------------------------------------------------------------
533  {
534  typedef std::unordered_map<uint64_t, uint64_t> scanty_outs_t;
535 
536  explicit not_enough_outs_to_mix(std::string&& loc, const scanty_outs_t& scanty_outs, size_t mixin_count)
537  : transfer_error(std::move(loc), "not enough outputs to use")
540  {
541  }
542 
543  const scanty_outs_t& scanty_outs() const { return m_scanty_outs; }
544  size_t mixin_count() const { return m_mixin_count; }
545 
546  std::string to_string() const
547  {
548  std::ostringstream ss;
549  ss << transfer_error::to_string() << ", ring size = " << (m_mixin_count + 1) << ", scanty_outs:";
550  for (const auto& out: m_scanty_outs)
551  {
552  ss << '\n' << cryptonote::print_money(out.first) << " - " << out.second;
553  }
554  return ss.str();
555  }
556 
557  private:
560  };
561  //----------------------------------------------------------------------------------------------------
563  {
564  typedef std::vector<cryptonote::tx_source_entry> sources_t;
565  typedef std::vector<cryptonote::tx_destination_entry> destinations_t;
566 
568  std::string && loc
569  , sources_t const & sources
570  , destinations_t const & destinations
571  , uint64_t unlock_time
572  , cryptonote::network_type nettype
573  )
574  : transfer_error(std::move(loc), "transaction was not constructed")
575  , m_sources(sources)
578  , m_nettype(nettype)
579  {
580  }
581 
582  const sources_t& sources() const { return m_sources; }
583  const destinations_t& destinations() const { return m_destinations; }
584  uint64_t unlock_time() const { return m_unlock_time; }
585 
586  std::string to_string() const
587  {
588  std::ostringstream ss;
590  ss << "\nSources:";
591  for (size_t i = 0; i < m_sources.size(); ++i)
592  {
593  const cryptonote::tx_source_entry& src = m_sources[i];
594  ss << "\n source " << i << ":";
595  ss << "\n amount: " << cryptonote::print_money(src.amount);
596  // It's not good, if logs will contain such much data
597  //ss << "\n real_output: " << src.real_output;
598  //ss << "\n real_output_in_tx_index: " << src.real_output_in_tx_index;
599  //ss << "\n real_out_tx_key: " << epee::string_tools::pod_to_hex(src.real_out_tx_key);
600  //ss << "\n outputs:";
601  //for (size_t j = 0; j < src.outputs.size(); ++j)
602  //{
603  // const cryptonote::tx_source_entry::output_entry& out = src.outputs[j];
604  // ss << "\n " << j << ": " << out.first << ", " << epee::string_tools::pod_to_hex(out.second);
605  //}
606  }
607 
608  ss << "\nDestinations:";
609  for (size_t i = 0; i < m_destinations.size(); ++i)
610  {
612  ss << "\n " << i << ": " << cryptonote::get_account_address_as_str(m_nettype, dst.is_subaddress, dst.addr) << " " <<
614  }
615 
616  ss << "\nunlock_time: " << m_unlock_time;
617 
618  return ss.str();
619  }
620 
621  private:
624  uint64_t m_unlock_time;
626  };
627  //----------------------------------------------------------------------------------------------------
628  struct tx_rejected : public transfer_error
629  {
630  explicit tx_rejected(std::string&& loc, const cryptonote::transaction& tx, const std::string& status, const std::string& reason)
631  : transfer_error(std::move(loc), "transaction was rejected by daemon")
632  , m_tx(tx)
633  , m_status(status)
634  , m_reason(reason)
635  {
636  }
637 
638  const cryptonote::transaction& tx() const { return m_tx; }
639  const std::string& status() const { return m_status; }
640  const std::string& reason() const { return m_reason; }
641 
642  std::string to_string() const
643  {
644  std::ostringstream ss;
645  ss << transfer_error::to_string() << ", status = " << m_status << ", tx:\n";
648  if (!m_reason.empty())
649  {
650  ss << " (" << m_reason << ")";
651  }
652  return ss.str();
653  }
654 
655  private:
657  std::string m_status;
658  std::string m_reason;
659  };
660  //----------------------------------------------------------------------------------------------------
662  {
663  explicit tx_sum_overflow(
664  std::string && loc
665  , const std::vector<cryptonote::tx_destination_entry>& destinations
666  , uint64_t fee
667  , cryptonote::network_type nettype
668  )
669  : transfer_error(std::move(loc), "transaction sum + fee exceeds " + cryptonote::print_money(std::numeric_limits<uint64_t>::max()))
671  , m_fee(fee)
672  , m_nettype(nettype)
673  {
674  }
675 
676  const std::vector<cryptonote::tx_destination_entry>& destinations() const { return m_destinations; }
677  uint64_t fee() const { return m_fee; }
678 
679  std::string to_string() const
680  {
681  std::ostringstream ss;
682  ss << transfer_error::to_string() <<
683  ", fee = " << cryptonote::print_money(m_fee) <<
684  ", destinations:";
685  for (const auto& dst : m_destinations)
686  {
687  ss << '\n' << cryptonote::print_money(dst.amount) << " -> " << cryptonote::get_account_address_as_str(m_nettype, dst.is_subaddress, dst.addr);
688  }
689  return ss.str();
690  }
691 
692  private:
693  std::vector<cryptonote::tx_destination_entry> m_destinations;
694  uint64_t m_fee;
696  };
697  //----------------------------------------------------------------------------------------------------
698  struct tx_too_big : public transfer_error
699  {
700  explicit tx_too_big(std::string&& loc, const cryptonote::transaction& tx, uint64_t tx_weight_limit)
701  : transfer_error(std::move(loc), "transaction is too big")
702  , m_tx(tx)
703  , m_tx_valid(true)
706  {
707  }
708 
709  explicit tx_too_big(std::string&& loc, uint64_t tx_weight, uint64_t tx_weight_limit)
710  : transfer_error(std::move(loc), "transaction would be too big")
711  , m_tx_valid(false)
714  {
715  }
716 
717  bool tx_valid() const { return m_tx_valid; }
718  const cryptonote::transaction& tx() const { return m_tx; }
719  uint64_t tx_weight() const { return m_tx_weight; }
720  uint64_t tx_weight_limit() const { return m_tx_weight_limit; }
721 
722  std::string to_string() const
723  {
724  std::ostringstream ss;
725  ss << transfer_error::to_string() <<
726  ", tx_weight_limit = " << m_tx_weight_limit <<
727  ", tx weight = " << m_tx_weight;
728  if (m_tx_valid)
729  {
731  ss << ", tx:\n" << cryptonote::obj_to_json_str(tx);
732  }
733  return ss.str();
734  }
735 
736  private:
739  uint64_t m_tx_weight;
741  };
742  //----------------------------------------------------------------------------------------------------
744  {
745  explicit zero_destination(std::string&& loc)
746  : transfer_error(std::move(loc), "destination amount is zero")
747  {
748  }
749  };
750  //----------------------------------------------------------------------------------------------------
752  {
753  const std::string& request() const { return m_request; }
754 
755  std::string to_string() const
756  {
757  std::ostringstream ss;
758  ss << wallet_logic_error::to_string() << ", request = " << m_request;
759  return ss.str();
760  }
761 
762  protected:
763  explicit wallet_rpc_error(std::string&& loc, const std::string& message, const std::string& request)
764  : wallet_logic_error(std::move(loc), message)
765  , m_request(request)
766  {
767  }
768 
769  private:
770  std::string m_request;
771  };
772  //----------------------------------------------------------------------------------------------------
774  {
775  explicit wallet_generic_rpc_error(std::string&& loc, const std::string& request, const std::string& status)
776  : wallet_rpc_error(std::move(loc), std::string("error in ") + request + " RPC: " + status, request),
778  {
779  }
780  const std::string& status() const { return m_status; }
781  private:
782  const std::string m_status;
783  };
784  //----------------------------------------------------------------------------------------------------
786  {
787  explicit wallet_coded_rpc_error(std::string&& loc, const std::string& request, int code, const std::string& status)
788  : wallet_rpc_error(std::move(loc), std::string("error ") + std::to_string(code) + (" in ") + request + " RPC: " + status, request),
790  {
791  }
792  int code() const { return m_code; }
793  const std::string& status() const { return m_status; }
794  private:
795  int m_code;
796  const std::string m_status;
797  };
798  //----------------------------------------------------------------------------------------------------
800  {
801  explicit daemon_busy(std::string&& loc, const std::string& request)
802  : wallet_rpc_error(std::move(loc), "daemon is busy", request)
803  {
804  }
805  };
806  //----------------------------------------------------------------------------------------------------
808  {
809  explicit no_connection_to_daemon(std::string&& loc, const std::string& request)
810  : wallet_rpc_error(std::move(loc), "no connection to daemon", request)
811  {
812  }
813  };
814  //----------------------------------------------------------------------------------------------------
816  {
817  explicit is_key_image_spent_error(std::string&& loc, const std::string& request)
818  : wallet_rpc_error(std::move(loc), "error from is_key_image_spent call", request)
819  {
820  }
821  };
822  //----------------------------------------------------------------------------------------------------
824  {
825  explicit get_histogram_error(std::string&& loc, const std::string& request)
826  : wallet_rpc_error(std::move(loc), "failed to get output histogram", request)
827  {
828  }
829  };
830  //----------------------------------------------------------------------------------------------------
832  {
833  explicit get_output_distribution(std::string&& loc, const std::string& request)
834  : wallet_rpc_error(std::move(loc), "failed to get output distribution", request)
835  {
836  }
837  };
838  //----------------------------------------------------------------------------------------------------
840  {
841  explicit payment_required(std::string&& loc, const std::string& request)
842  : wallet_rpc_error(std::move(loc), "payment required", request)
843  {
844  }
845  };
846  //----------------------------------------------------------------------------------------------------
848  {
849  explicit wallet_files_doesnt_correspond(std::string&& loc, const std::string& keys_file, const std::string& wallet_file)
850  : wallet_logic_error(std::move(loc), "file " + wallet_file + " does not correspond to " + keys_file)
851  {
852  }
853 
854  const std::string& keys_file() const { return m_keys_file; }
855  const std::string& wallet_file() const { return m_wallet_file; }
856 
857  std::string to_string() const { return wallet_logic_error::to_string(); }
858 
859  private:
860  std::string m_keys_file;
861  std::string m_wallet_file;
862  };
863  //----------------------------------------------------------------------------------------------------
865  {
866  protected:
867  explicit mms_error(std::string&& loc, const std::string& message)
868  : wallet_logic_error(std::move(loc), message)
869  {
870  }
871  };
872  //----------------------------------------------------------------------------------------------------
874  {
875  explicit no_connection_to_bitmessage(std::string&& loc, const std::string& address)
876  : mms_error(std::move(loc), "no connection to PyBitmessage at address " + address)
877  {
878  }
879  };
880  //----------------------------------------------------------------------------------------------------
882  {
883  explicit bitmessage_api_error(std::string&& loc, const std::string& error_string)
884  : mms_error(std::move(loc), "PyBitmessage returned " + error_string)
885  {
886  }
887  };
888  //----------------------------------------------------------------------------------------------------
889 
890 #if !defined(_MSC_VER)
891 
892  template<typename TException, typename... TArgs>
893  void throw_wallet_ex(std::string&& loc, const TArgs&... args)
894  {
895  TException e(std::move(loc), args...);
896  LOG_PRINT_L0(e.to_string());
897  throw e;
898  }
899 
900 #else
901  #include <boost/preprocessor/repetition/enum_binary_params.hpp>
902  #include <boost/preprocessor/repetition/enum_params.hpp>
903  #include <boost/preprocessor/repetition/repeat_from_to.hpp>
904 
905  template<typename TException>
906  void throw_wallet_ex(std::string&& loc)
907  {
908  TException e(std::move(loc));
909  LOG_PRINT_L0(e.to_string());
910  throw e;
911  }
912 
913 #define GEN_throw_wallet_ex(z, n, data) \
914  template<typename TException, BOOST_PP_ENUM_PARAMS(n, typename TArg)> \
915  void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \
916  { \
917  TException e(std::move(loc), BOOST_PP_ENUM_PARAMS(n, arg)); \
918  LOG_PRINT_L0(e.to_string()); \
919  throw e; \
920  }
921 
922  BOOST_PP_REPEAT_FROM_TO(1, 6, GEN_throw_wallet_ex, ~)
923 #endif
924  }
925 }
926 
927 #define STRINGIZE_DETAIL(x) #x
928 #define STRINGIZE(x) STRINGIZE_DETAIL(x)
929 
930 #define THROW_WALLET_EXCEPTION(err_type, ...) \
931  do { \
932  LOG_ERROR("THROW EXCEPTION: " << #err_type); \
933  tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
934  } while(0)
935 
936 #define THROW_WALLET_EXCEPTION_IF(cond, err_type, ...) \
937  if (cond) \
938  { \
939  LOG_ERROR(#cond << ". THROW EXCEPTION: " << #err_type); \
940  tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
941  }
tools::error::tx_not_possible::tx_not_possible
tx_not_possible(std::string &&loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:504
tools::error::acc_outs_lookup_error::to_string
std::string to_string() const
Definition: wallet_errors.h:359
tools::error::tx_not_constructed::m_destinations
destinations_t m_destinations
Definition: wallet_errors.h:623
tools::error::invalid_password::invalid_password
invalid_password(std::string &&loc)
Definition: wallet_errors.h:275
tools::error::file_error_base::file
const std::string & file() const
Definition: wallet_errors.h:260
tools::error::password_needed::password_needed
password_needed(std::string &&loc, const std::string &msg="Password needed")
Definition: wallet_errors.h:217
tools::error::tx_rejected::tx
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:638
tools::error::tx_parse_error::tx_parse_error
tx_parse_error(std::string &&loc, const cryptonote::blobdata &tx_blob)
Definition: wallet_errors.h:397
tools::error::invalid_priority
Definition: wallet_errors.h:283
tools::error::unexpected_txin_type::tx
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:177
tools::error::not_enough_outs_to_mix::to_string
std::string to_string() const
Definition: wallet_errors.h:546
cryptonote::get_account_address_as_str
std::string get_account_address_as_str(network_type nettype, bool subaddress, account_public_address const &adr)
Definition: cryptonote_basic_impl.cpp:150
tools::error::file_error_message_indices
file_error_message_indices
Definition: wallet_errors.h:238
tools::error::get_output_distribution
Definition: wallet_errors.h:832
tools::error::wallet_coded_rpc_error
Definition: wallet_errors.h:786
tools::error::get_output_distribution::get_output_distribution
get_output_distribution(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:833
tools::error::tx_not_constructed::m_nettype
cryptonote::network_type m_nettype
Definition: wallet_errors.h:625
tools::error::tx_sum_overflow::to_string
std::string to_string() const
Definition: wallet_errors.h:679
cryptonote::tx_destination_entry
Definition: cryptonote_tx_utils.h:75
tools::error::account_index_outofbound
Definition: wallet_errors.h:330
tools::error::acc_outs_lookup_error::acc_outs_lookup_error
acc_outs_lookup_error(std::string &&loc, const cryptonote::transaction &tx, const crypto::public_key &tx_pub_key, const cryptonote::account_keys &acc_keys)
Definition: wallet_errors.h:346
tools::error::tx_too_big::tx
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:718
tools::error::wallet_coded_rpc_error::wallet_coded_rpc_error
wallet_coded_rpc_error(std::string &&loc, const std::string &request, int code, const std::string &status)
Definition: wallet_errors.h:787
cryptonote::obj_to_json_str
std::string obj_to_json_str(T &obj)
Definition: cryptonote_format_utils.h:199
tools::error::not_enough_outs_to_mix
Definition: wallet_errors.h:533
tools::error::failed_rpc_request_messages
const char *const failed_rpc_request_messages[]
Definition: wallet_errors.h:122
tools::error::block_parse_error::to_string
std::string to_string() const
Definition: wallet_errors.h:383
tools::error::address_index_outofbound::address_index_outofbound
address_index_outofbound(std::string &&loc)
Definition: wallet_errors.h:338
tools::error::not_enough_unlocked_money::tx_amount
uint64_t tx_amount() const
Definition: wallet_errors.h:460
tools::error::bitmessage_api_error::bitmessage_api_error
bitmessage_api_error(std::string &&loc, const std::string &error_string)
Definition: wallet_errors.h:883
tools::error::out_of_hashchain_bounds_error
Definition: wallet_errors.h:422
tools::error::get_histogram_error
Definition: wallet_errors.h:824
tools::error::not_enough_unlocked_money
Definition: wallet_errors.h:451
tools::error::not_enough_outs_to_mix::m_scanty_outs
scanty_outs_t m_scanty_outs
Definition: wallet_errors.h:558
tools::error::wallet_files_doesnt_correspond::keys_file
const std::string & keys_file() const
Definition: wallet_errors.h:854
tools::error::multisig_export_needed
Definition: wallet_errors.h:200
tools::error::tx_sum_overflow::destinations
const std::vector< cryptonote::tx_destination_entry > & destinations() const
Definition: wallet_errors.h:676
tools::error::tx_not_constructed
Definition: wallet_errors.h:563
tools::error::not_enough_unlocked_money::to_string
std::string to_string() const
Definition: wallet_errors.h:462
tools::error::wallet_error_base::to_string
std::string to_string() const
Definition: wallet_errors.h:104
tools::error::invalid_password
Definition: wallet_errors.h:274
tools::error::tx_not_possible::tx_amount
uint64_t tx_amount() const
Definition: wallet_errors.h:513
tools::error::wallet_rpc_error::to_string
std::string to_string() const
Definition: wallet_errors.h:755
tools::error::tx_rejected::tx_rejected
tx_rejected(std::string &&loc, const cryptonote::transaction &tx, const std::string &status, const std::string &reason)
Definition: wallet_errors.h:630
tools::error::address_index_outofbound
Definition: wallet_errors.h:337
tools::error::account_index_outofbound::account_index_outofbound
account_index_outofbound(std::string &&loc)
Definition: wallet_errors.h:331
tools::error::not_enough_outs_to_mix::not_enough_outs_to_mix
not_enough_outs_to_mix(std::string &&loc, const scanty_outs_t &scanty_outs, size_t mixin_count)
Definition: wallet_errors.h:536
cryptonote::network_type
network_type
Definition: cryptonote_config.h:268
tools::error::file_exists
file_error_base< file_exists_message_index > file_exists
Definition: wallet_errors.h:268
tools::error::wallet_generic_rpc_error::wallet_generic_rpc_error
wallet_generic_rpc_error(std::string &&loc, const std::string &request, const std::string &status)
Definition: wallet_errors.h:775
tools::error::acc_outs_lookup_error::tx_pub_key
const crypto::public_key & tx_pub_key() const
Definition: wallet_errors.h:356
tools::error::tx_not_possible::m_fee
uint64_t m_fee
Definition: wallet_errors.h:529
tools::error::tx_too_big::m_tx_valid
bool m_tx_valid
Definition: wallet_errors.h:738
tools::error::failed_rpc_request
Definition: wallet_errors.h:138
tools::error::zero_destination
Definition: wallet_errors.h:744
tools::error::tx_too_big::m_tx
cryptonote::transaction m_tx
Definition: wallet_errors.h:737
tools::error::transfer_error::transfer_error
transfer_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:442
tools::error::file_error_base::to_string
std::string to_string() const
Definition: wallet_errors.h:262
tools::error::not_enough_outs_to_mix::scanty_outs_t
std::unordered_map< uint64_t, uint64_t > scanty_outs_t
Definition: wallet_errors.h:534
tools::error::tx_sum_overflow::m_destinations
std::vector< cryptonote::tx_destination_entry > m_destinations
Definition: wallet_errors.h:693
tools::error::tx_too_big::tx_weight
uint64_t tx_weight() const
Definition: wallet_errors.h:719
tools::error::password_needed
Definition: wallet_errors.h:216
tools::error::no_connection_to_daemon::no_connection_to_daemon
no_connection_to_daemon(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:809
tools::error::signature_check_failed::signature_check_failed
signature_check_failed(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:433
tools::error::wallet_files_doesnt_correspond::m_wallet_file
std::string m_wallet_file
Definition: wallet_errors.h:861
tools::error::block_parse_error::block_blob
const cryptonote::blobdata & block_blob() const
Definition: wallet_errors.h:381
tools::error::wallet_rpc_error::wallet_rpc_error
wallet_rpc_error(std::string &&loc, const std::string &message, const std::string &request)
Definition: wallet_errors.h:763
tools::error::unexpected_txin_type::to_string
std::string to_string() const
Definition: wallet_errors.h:179
tools::error::tx_not_constructed::tx_not_constructed
tx_not_constructed(std::string &&loc, sources_t const &sources, destinations_t const &destinations, uint64_t unlock_time, cryptonote::network_type nettype)
Definition: wallet_errors.h:567
tools::error::daemon_busy::daemon_busy
daemon_busy(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:801
tools::error::acc_outs_lookup_error::m_tx
const cryptonote::transaction m_tx
Definition: wallet_errors.h:368
tools::error::get_histogram_error::get_histogram_error
get_histogram_error(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:825
tools::error::no_connection_to_bitmessage
Definition: wallet_errors.h:874
tools::error::tx_sum_overflow::fee
uint64_t fee() const
Definition: wallet_errors.h:677
tools::error::not_enough_unlocked_money::m_available
uint64_t m_available
Definition: wallet_errors.h:472
tools::error::invalid_password::to_string
std::string to_string() const
Definition: wallet_errors.h:280
tools::error::tx_parse_error::m_tx_blob
cryptonote::blobdata m_tx_blob
Definition: wallet_errors.h:408
tools::error::wallet_files_doesnt_correspond::wallet_files_doesnt_correspond
wallet_files_doesnt_correspond(std::string &&loc, const std::string &keys_file, const std::string &wallet_file)
Definition: wallet_errors.h:849
tools::error::invalid_priority::invalid_priority
invalid_priority(std::string &&loc)
Definition: wallet_errors.h:284
tools::error::tx_not_constructed::m_unlock_time
uint64_t m_unlock_time
Definition: wallet_errors.h:624
tools::error::wallet_error_base::m_loc
std::string m_loc
Definition: wallet_errors.h:119
tools::error::tx_too_big::tx_valid
bool tx_valid() const
Definition: wallet_errors.h:717
tools::error::failed_rpc_request::to_string
std::string to_string() const
Definition: wallet_errors.h:147
tools::error::out_of_hashchain_bounds_error::out_of_hashchain_bounds_error
out_of_hashchain_bounds_error(std::string &&loc)
Definition: wallet_errors.h:423
tools::error::wallet_not_initialized::wallet_not_initialized
wallet_not_initialized(std::string &&loc)
Definition: wallet_errors.h:193
tools::error::payment_required
Definition: wallet_errors.h:840
tools::error::wallet_logic_error
wallet_error_base< std::logic_error > wallet_logic_error
Definition: wallet_errors.h:158
tools::error::acc_outs_lookup_error::m_acc_keys
const cryptonote::account_keys m_acc_keys
Definition: wallet_errors.h:370
tools::error::not_enough_money::available
uint64_t available() const
Definition: wallet_errors.h:485
tools::error::acc_outs_lookup_error::m_tx_pub_key
const crypto::public_key m_tx_pub_key
Definition: wallet_errors.h:369
tools::error::file_not_found
file_error_base< file_not_found_message_index > file_not_found
Definition: wallet_errors.h:269
tools::error::file_not_found_message_index
@ file_not_found_message_index
Definition: wallet_errors.h:240
tools::error::failed_rpc_request::status
const std::string & status() const
Definition: wallet_errors.h:145
tools::error::tx_not_constructed::destinations
const destinations_t & destinations() const
Definition: wallet_errors.h:583
cryptonote::tx_destination_entry::addr
account_public_address addr
Definition: cryptonote_tx_utils.h:78
tools::error::no_connection_to_daemon
Definition: wallet_errors.h:808
tools::error::file_error_base
Definition: wallet_errors.h:247
cryptonote::tx_source_entry
Definition: cryptonote_tx_utils.h:43
tools::error::wallet_coded_rpc_error::m_status
const std::string m_status
Definition: wallet_errors.h:796
cryptonote::tx_destination_entry::is_subaddress
bool is_subaddress
Definition: cryptonote_tx_utils.h:79
build_protob.args
args
Definition: build_protob.py:10
tools::error::tx_rejected::m_reason
std::string m_reason
Definition: wallet_errors.h:658
cryptonote::print_money
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:1028
tools::error::wallet_coded_rpc_error::code
int code() const
Definition: wallet_errors.h:792
tools::error::wallet_error_base::wallet_error_base
wallet_error_base(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:112
tools::error::not_enough_outs_to_mix::scanty_outs
const scanty_outs_t & scanty_outs() const
Definition: wallet_errors.h:543
tools::error::file_save_error
file_error_base< file_save_error_message_index > file_save_error
Definition: wallet_errors.h:271
tools::error::throw_wallet_ex
void throw_wallet_ex(std::string &&loc, const TArgs &... args)
Definition: wallet_errors.h:893
cryptonote_tx_utils.h
tools::error::mms_error::mms_error
mms_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:867
tools::error::password_entry_failed
Definition: wallet_errors.h:224
tools::error::file_error_messages
const char *const file_error_messages[]
Definition: wallet_errors.h:231
tools::error::not_enough_unlocked_money::m_tx_amount
uint64_t m_tx_amount
Definition: wallet_errors.h:473
tools::error::block_parse_error
Definition: wallet_errors.h:374
tools::error::tx_too_big::tx_weight_limit
uint64_t tx_weight_limit() const
Definition: wallet_errors.h:720
tools::error::wallet_files_doesnt_correspond::m_keys_file
std::string m_keys_file
Definition: wallet_errors.h:860
tools::error::wallet_error_base::location
const std::string & location() const
Definition: wallet_errors.h:102
cryptonote_format_utils.h
tools::error::not_enough_money::to_string
std::string to_string() const
Definition: wallet_errors.h:488
tools::error::tx_not_constructed::sources_t
std::vector< cryptonote::tx_source_entry > sources_t
Definition: wallet_errors.h:564
tools::error::failed_rpc_request_message_indices
failed_rpc_request_message_indices
Definition: wallet_errors.h:129
tools::error::wallet_runtime_error
wallet_error_base< std::runtime_error > wallet_runtime_error
Definition: wallet_errors.h:159
cryptonote::account_keys
Definition: account.h:41
tools::error::invalid_multisig_seed
Definition: wallet_errors.h:293
tools::error::not_enough_outs_to_mix::mixin_count
size_t mixin_count() const
Definition: wallet_errors.h:544
tools::error::tx_not_constructed::unlock_time
uint64_t unlock_time() const
Definition: wallet_errors.h:584
tools::error::tx_parse_error::tx_blob
const cryptonote::blobdata & tx_blob() const
Definition: wallet_errors.h:403
cryptonote
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:45
tools::error::tx_sum_overflow
Definition: wallet_errors.h:662
tools::error::tx_not_possible::available
uint64_t available() const
Definition: wallet_errors.h:512
tools::error::wallet_files_doesnt_correspond
Definition: wallet_errors.h:848
tools::error::invalid_multisig_seed::invalid_multisig_seed
invalid_multisig_seed(std::string &&loc)
Definition: wallet_errors.h:294
tools::error::get_out_indices_error_message_index
@ get_out_indices_error_message_index
Definition: wallet_errors.h:132
tools::error::invalid_pregenerated_random::to_string
std::string to_string() const
Definition: wallet_errors.h:310
false
#define false
Definition: stdbool.h:37
tools::error::signature_check_failed
Definition: wallet_errors.h:432
tools::error::get_hashes_error_message_index
@ get_hashes_error_message_index
Definition: wallet_errors.h:131
tools::error::acc_outs_lookup_error::tx
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:355
tools::error::block_parse_error::block_parse_error
block_parse_error(std::string &&loc, const cryptonote::blobdata &block_data)
Definition: wallet_errors.h:375
tools::error::tx_too_big::to_string
std::string to_string() const
Definition: wallet_errors.h:722
tools::error::payment_required::payment_required
payment_required(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:841
tools::error::tx_not_constructed::m_sources
sources_t m_sources
Definition: wallet_errors.h:622
tools
Various Tools.
Definition: apply_permutation.h:40
tools::error::tx_sum_overflow::m_nettype
cryptonote::network_type m_nettype
Definition: wallet_errors.h:695
tools::error::is_key_image_spent_error
Definition: wallet_errors.h:816
core_rpc_server_commands_defs.h
tools::error::multisig_import_needed
Definition: wallet_errors.h:208
tools::error::out_of_hashchain_bounds_error::to_string
std::string to_string() const
Definition: wallet_errors.h:428
tools::error::not_enough_money::not_enough_money
not_enough_money(std::string &&loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:478
tools::error::tx_parse_error::to_string
std::string to_string() const
Definition: wallet_errors.h:405
tools::error::wallet_coded_rpc_error::status
const std::string & status() const
Definition: wallet_errors.h:793
tools::error::file_read_error
file_error_base< file_read_error_message_index > file_read_error
Definition: wallet_errors.h:270
tools::error::refresh_error::refresh_error
refresh_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:316
tools::error::invalid_pregenerated_random::invalid_pregenerated_random
invalid_pregenerated_random(std::string &&loc)
Definition: wallet_errors.h:305
tools::error::not_enough_money::m_tx_amount
uint64_t m_tx_amount
Definition: wallet_errors.h:499
crypto::public_key
POD_CLASS public_key
Definition: crypto.h:61
tools::error::index_outofbound
Definition: wallet_errors.h:323
cryptonote::tx_source_entry::amount
uint64_t amount
Definition: cryptonote_tx_utils.h:51
tools::error::wallet_files_doesnt_correspond::wallet_file
const std::string & wallet_file() const
Definition: wallet_errors.h:855
tools::error::get_outs_error
failed_rpc_request< transfer_error, get_outs_error_message_index > get_outs_error
Definition: wallet_errors.h:448
tools::error::tx_not_possible::fee
uint64_t fee() const
Definition: wallet_errors.h:514
cryptonote::blobdata
std::string blobdata
Definition: blobdatatype.h:39
tools::error::wallet_generic_rpc_error::status
const std::string & status() const
Definition: wallet_errors.h:780
tools::error::not_enough_unlocked_money::available
uint64_t available() const
Definition: wallet_errors.h:459
tools::error::file_save_error_message_index
@ file_save_error_message_index
Definition: wallet_errors.h:242
tools::error::get_tx_pool_error::get_tx_pool_error
get_tx_pool_error(std::string &&loc)
Definition: wallet_errors.h:413
tools::error::wallet_files_doesnt_correspond::to_string
std::string to_string() const
Definition: wallet_errors.h:857
tools::error::wallet_generic_rpc_error
Definition: wallet_errors.h:774
tools::error::wallet_error_base
Definition: wallet_errors.h:101
tools::error::acc_outs_lookup_error::acc_keys
const cryptonote::account_keys & acc_keys() const
Definition: wallet_errors.h:357
tools::error::get_blocks_error_message_index
@ get_blocks_error_message_index
Definition: wallet_errors.h:130
tools::error::daemon_busy
Definition: wallet_errors.h:800
tools::error::wallet_rpc_error
Definition: wallet_errors.h:752
tools::error::transfer_error
Definition: wallet_errors.h:440
tools::error::tx_not_constructed::sources
const sources_t & sources() const
Definition: wallet_errors.h:582
tools::error::failed_rpc_request::failed_rpc_request
failed_rpc_request(std::string &&loc, const std::string &status)
Definition: wallet_errors.h:139
tools::error::tx_rejected::status
const std::string & status() const
Definition: wallet_errors.h:639
tools::error::wallet_rpc_error::request
const std::string & request() const
Definition: wallet_errors.h:753
tools::error::tx_not_constructed::to_string
std::string to_string() const
Definition: wallet_errors.h:586
std
Definition: blockchain_ancestry.cpp:72
tools::error::invalid_priority::to_string
std::string to_string() const
Definition: wallet_errors.h:289
tools::error::index_outofbound::index_outofbound
index_outofbound(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:324
tools::error::zero_destination::zero_destination
zero_destination(std::string &&loc)
Definition: wallet_errors.h:745
tools::error::tx_too_big::tx_too_big
tx_too_big(std::string &&loc, uint64_t tx_weight, uint64_t tx_weight_limit)
Definition: wallet_errors.h:709
tools::error::mms_error
Definition: wallet_errors.h:865
tools::error::get_tx_pool_error::to_string
std::string to_string() const
Definition: wallet_errors.h:418
tools::error::wallet_not_initialized
Definition: wallet_errors.h:192
tools::error::tx_not_constructed::destinations_t
std::vector< cryptonote::tx_destination_entry > destinations_t
Definition: wallet_errors.h:565
tools::error::tx_not_possible::m_tx_amount
uint64_t m_tx_amount
Definition: wallet_errors.h:528
tools::error::tx_not_possible::to_string
std::string to_string() const
Definition: wallet_errors.h:516
tools::error::not_enough_money::m_available
uint64_t m_available
Definition: wallet_errors.h:498
tools::error::wallet_generic_rpc_error::m_status
const std::string m_status
Definition: wallet_errors.h:782
tools::error::block_parse_error::m_block_blob
cryptonote::blobdata m_block_blob
Definition: wallet_errors.h:386
cryptonote::transaction
Definition: cryptonote_basic.h:194
tools::error::invalid_multisig_seed::to_string
std::string to_string() const
Definition: wallet_errors.h:299
tools::error::failed_rpc_request::m_status
std::string m_status
Definition: wallet_errors.h:155
tools::error::tx_not_possible::m_available
uint64_t m_available
Definition: wallet_errors.h:527
tools::error::wallet_coded_rpc_error::m_code
int m_code
Definition: wallet_errors.h:795
tools::error::tx_too_big
Definition: wallet_errors.h:699
tools::error::invalid_pregenerated_random
Definition: wallet_errors.h:304
tools::error::tx_too_big::tx_too_big
tx_too_big(std::string &&loc, const cryptonote::transaction &tx, uint64_t tx_weight_limit)
Definition: wallet_errors.h:700
tools::error::wallet_rpc_error::m_request
std::string m_request
Definition: wallet_errors.h:770
tools::error::multisig_import_needed::multisig_import_needed
multisig_import_needed(std::string &&loc)
Definition: wallet_errors.h:209
tools::error::tx_rejected
Definition: wallet_errors.h:629
tools::error::get_out_indices_error
failed_rpc_request< refresh_error, get_out_indices_error_message_index > get_out_indices_error
Definition: wallet_errors.h:393
tools::error::tx_parse_error
Definition: wallet_errors.h:396
tools::error::bitmessage_api_error
Definition: wallet_errors.h:882
tools::error::tx_sum_overflow::m_fee
uint64_t m_fee
Definition: wallet_errors.h:694
tools::error::no_connection_to_bitmessage::no_connection_to_bitmessage
no_connection_to_bitmessage(std::string &&loc, const std::string &address)
Definition: wallet_errors.h:875
tools::error::tx_not_possible
Definition: wallet_errors.h:503
tools::error::wallet_internal_error
Definition: wallet_errors.h:162
tools::error::multisig_export_needed::multisig_export_needed
multisig_export_needed(std::string &&loc)
Definition: wallet_errors.h:201
tools::error::tx_rejected::reason
const std::string & reason() const
Definition: wallet_errors.h:640
tools::error::tx_rejected::m_tx
cryptonote::transaction m_tx
Definition: wallet_errors.h:656
cryptonote::tx_destination_entry::amount
uint64_t amount
Definition: cryptonote_tx_utils.h:77
tools::error::unexpected_txin_type::unexpected_txin_type
unexpected_txin_type(std::string &&loc, const cryptonote::transaction &tx)
Definition: wallet_errors.h:171
tools::error::tx_too_big::m_tx_weight_limit
uint64_t m_tx_weight_limit
Definition: wallet_errors.h:740
tools::error::wallet_internal_error::wallet_internal_error
wallet_internal_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:163
true
#define true
Definition: stdbool.h:36
tools::error::is_key_image_spent_error::is_key_image_spent_error
is_key_image_spent_error(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:817
tools::error::not_enough_outs_to_mix::m_mixin_count
size_t m_mixin_count
Definition: wallet_errors.h:559
tools::error::unexpected_txin_type::m_tx
cryptonote::transaction m_tx
Definition: wallet_errors.h:188
cryptonote::get_transaction_weight
uint64_t get_transaction_weight(const transaction &tx, size_t blob_size)
Definition: cryptonote_format_utils.cpp:421
tools::error::get_tx_pool_error
Definition: wallet_errors.h:412
tools::error::refresh_error
Definition: wallet_errors.h:314
tools::error::file_exists_message_index
@ file_exists_message_index
Definition: wallet_errors.h:239
tools::error::password_entry_failed::password_entry_failed
password_entry_failed(std::string &&loc, const std::string &msg="Password entry failed")
Definition: wallet_errors.h:225
tools::error::tx_rejected::m_status
std::string m_status
Definition: wallet_errors.h:657
tools::error::tx_too_big::m_tx_weight
uint64_t m_tx_weight
Definition: wallet_errors.h:739
tools::error::not_enough_unlocked_money::not_enough_unlocked_money
not_enough_unlocked_money(std::string &&loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:452
tools::error::unexpected_txin_type
Definition: wallet_errors.h:170
tools::error::get_blocks_error
failed_rpc_request< refresh_error, get_blocks_error_message_index > get_blocks_error
Definition: wallet_errors.h:389
tools::error::get_outs_error_message_index
@ get_outs_error_message_index
Definition: wallet_errors.h:133
tools::error::acc_outs_lookup_error
Definition: wallet_errors.h:345
tools::error::file_error_base::m_file
std::string m_file
Definition: wallet_errors.h:265
tools::error::file_error_base::file_error_base
file_error_base(std::string &&loc, const std::string &file)
Definition: wallet_errors.h:248
lmdb::error
error
Tracks LMDB error codes.
Definition: error.h:45
tools::error::not_enough_money
Definition: wallet_errors.h:477
tools::error::get_hashes_error
failed_rpc_request< refresh_error, get_hashes_error_message_index > get_hashes_error
Definition: wallet_errors.h:391
tools::error::file_read_error_message_index
@ file_read_error_message_index
Definition: wallet_errors.h:241
tools::error::not_enough_money::tx_amount
uint64_t tx_amount() const
Definition: wallet_errors.h:486
tools::error::tx_rejected::to_string
std::string to_string() const
Definition: wallet_errors.h:642
tools::error::tx_sum_overflow::tx_sum_overflow
tx_sum_overflow(std::string &&loc, const std::vector< cryptonote::tx_destination_entry > &destinations, uint64_t fee, cryptonote::network_type nettype)
Definition: wallet_errors.h:663