Monero
wallet_errors.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2022, 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_amount
87  // zero_destination
88  // subtract_fee_from_bad_index
89  // wallet_rpc_error *
90  // daemon_busy
91  // no_connection_to_daemon
92  // is_key_image_spent_error
93  // get_histogram_error
94  // get_output_distribution
95  // payment_required
96  // wallet_files_doesnt_correspond
97  // scan_tx_error *
98  // wont_reprocess_recent_txs_via_untrusted_daemon
99  //
100  // * - class with protected ctor
101 
102  //----------------------------------------------------------------------------------------------------
103  template<typename Base>
104  struct wallet_error_base : public Base
105  {
106  const std::string& location() const { return m_loc; }
107 
109  {
110  std::ostringstream ss;
111  ss << m_loc << ':' << typeid(*this).name() << ": " << Base::what();
112  return ss.str();
113  }
114 
115  protected:
117  : Base(message)
118  , m_loc(loc)
119  {
120  }
121 
122  private:
124  };
125  //----------------------------------------------------------------------------------------------------
126  const char* const failed_rpc_request_messages[] = {
127  "failed to get blocks",
128  "failed to get hashes",
129  "failed to get out indices",
130  "failed to get random outs"
131  };
133  {
138  };
139 
140  template<typename Base, int msg_index>
141  struct failed_rpc_request : public Base
142  {
144  : Base(std::move(loc), failed_rpc_request_messages[msg_index])
145  , m_status(status)
146  {
147  }
148 
149  const std::string& status() const { return m_status; }
150 
152  {
153  std::ostringstream ss;
154  ss << Base::to_string() << ", status = " << status();
155  return ss.str();
156  }
157 
158  private:
160  };
161  //----------------------------------------------------------------------------------------------------
164  //----------------------------------------------------------------------------------------------------
166  {
169  {
170  }
171  };
172  //----------------------------------------------------------------------------------------------------
174  {
176  : wallet_internal_error(std::move(loc), "one of tx inputs has unexpected type")
177  , m_tx(tx)
178  {
179  }
180 
181  const cryptonote::transaction& tx() const { return m_tx; }
182 
184  {
185  std::ostringstream ss;
188  return ss.str();
189  }
190 
191  private:
193  };
194  //----------------------------------------------------------------------------------------------------
196  {
198  : wallet_internal_error(std::move(loc), "wallet is not initialized")
199  {
200  }
201  };
202  //----------------------------------------------------------------------------------------------------
204  {
206  : wallet_runtime_error(std::move(loc), "This signature was made with stale data: export fresh multisig data, which other participants must then use")
207  {
208  }
209  };
210  //----------------------------------------------------------------------------------------------------
212  {
214  : wallet_runtime_error(std::move(loc), "Not enough multisig data was found to sign: import multisig data from more other participants")
215  {
216  }
217  };
218  //----------------------------------------------------------------------------------------------------
220  {
221  explicit password_needed(std::string&& loc, const std::string &msg = "Password needed")
222  : wallet_runtime_error(std::move(loc), msg)
223  {
224  }
225  };
226  //----------------------------------------------------------------------------------------------------
228  {
229  explicit password_entry_failed(std::string&& loc, const std::string &msg = "Password entry failed")
230  : wallet_runtime_error(std::move(loc), msg)
231  {
232  }
233  };
234  //----------------------------------------------------------------------------------------------------
235  const char* const file_error_messages[] = {
236  "file already exists",
237  "file not found",
238  "failed to read file",
239  "failed to save file"
240  };
242  {
247  };
248 
249  template<int msg_index>
251  {
252  explicit file_error_base(std::string&& loc, const std::string& file)
253  : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + '\"')
254  , m_file(file)
255  {
256  }
257 
258  explicit file_error_base(std::string&& loc, const std::string& file, const std::error_code &e)
259  : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + "\": " + e.message())
260  , m_file(file)
261  {
262  }
263 
264  const std::string& file() const { return m_file; }
265 
267 
268  private:
270  };
271  //----------------------------------------------------------------------------------------------------
276  //----------------------------------------------------------------------------------------------------
278  {
280  : wallet_logic_error(std::move(loc), "invalid password")
281  {
282  }
283 
285  };
287  {
289  : wallet_logic_error(std::move(loc), "invalid priority")
290  {
291  }
292 
294  };
295 
297  {
299  : wallet_logic_error(std::move(loc), "invalid multisig seed")
300  {
301  }
302 
304  };
305 
306  //----------------------------------------------------------------------------------------------------
308  {
310  : wallet_logic_error(std::move(loc), "invalid pregenerated random for wallet creation/recovery")
311  {
312  }
313 
315  };
316  //----------------------------------------------------------------------------------------------------
318  {
319  protected:
322  {
323  }
324  };
325  //----------------------------------------------------------------------------------------------------
327  {
330  {
331  }
332  };
334  {
336  : index_outofbound(std::move(loc), "account index is out of bound")
337  {
338  }
339  };
341  {
343  : index_outofbound(std::move(loc), "address index is out of bound")
344  {
345  }
346  };
347  //----------------------------------------------------------------------------------------------------
349  {
352  : refresh_error(std::move(loc), "account outs lookup error")
353  , m_tx(tx)
356  {
357  }
358 
359  const cryptonote::transaction& tx() const { return m_tx; }
360  const crypto::public_key& tx_pub_key() const { return m_tx_pub_key; }
361  const cryptonote::account_keys& acc_keys() const { return m_acc_keys; }
362 
364  {
365  std::ostringstream ss;
368  return ss.str();
369  }
370 
371  private:
375  };
376  //----------------------------------------------------------------------------------------------------
378  {
379  explicit block_parse_error(std::string&& loc, const cryptonote::blobdata& block_data)
380  : refresh_error(std::move(loc), "block parse error")
381  , m_block_blob(block_data)
382  {
383  }
384 
385  const cryptonote::blobdata& block_blob() const { return m_block_blob; }
386 
388 
389  private:
391  };
392  //----------------------------------------------------------------------------------------------------
394  //----------------------------------------------------------------------------------------------------
396  //----------------------------------------------------------------------------------------------------
398  //----------------------------------------------------------------------------------------------------
400  {
402  : refresh_error(std::move(loc), "transaction parse error")
403  , m_tx_blob(tx_blob)
404  {
405  }
406 
407  const cryptonote::blobdata& tx_blob() const { return m_tx_blob; }
408 
410 
411  private:
413  };
414  //----------------------------------------------------------------------------------------------------
416  {
418  : refresh_error(std::move(loc), "error getting transaction pool")
419  {
420  }
421 
423  };
424  //----------------------------------------------------------------------------------------------------
426  {
428  : refresh_error(std::move(loc), "Index out of bounds of of hashchain")
429  {
430  }
431 
433  };
434  //----------------------------------------------------------------------------------------------------
436  {
438  : refresh_error(std::move(loc), message)
439  {
440  }
441 
443  };
444  //----------------------------------------------------------------------------------------------------
446  {
448  : refresh_error(std::move(loc), message)
449  {
450  }
451 
453  };
454  //----------------------------------------------------------------------------------------------------
456  {
458  : wallet_logic_error(std::move(loc), "Signature check failed " + message)
459  {
460  }
461  };
462  //----------------------------------------------------------------------------------------------------
464  {
465  protected:
468  {
469  }
470  };
471  //----------------------------------------------------------------------------------------------------
473  //----------------------------------------------------------------------------------------------------
475  {
477  : transfer_error(std::move(loc), "not enough unlocked money")
480  {
481  }
482 
483  uint64_t available() const { return m_available; }
484  uint64_t tx_amount() const { return m_tx_amount; }
485 
487  {
488  std::ostringstream ss;
489  ss << transfer_error::to_string() <<
490  ", available = " << cryptonote::print_money(m_available) <<
491  ", tx_amount = " << cryptonote::print_money(m_tx_amount);
492  return ss.str();
493  }
494 
495  private:
498  };
499  //----------------------------------------------------------------------------------------------------
501  {
503  : transfer_error(std::move(loc), "not enough money")
506  {
507  }
508 
509  uint64_t available() const { return m_available; }
510  uint64_t tx_amount() const { return m_tx_amount; }
511 
513  {
514  std::ostringstream ss;
515  ss << transfer_error::to_string() <<
516  ", available = " << cryptonote::print_money(m_available) <<
517  ", tx_amount = " << cryptonote::print_money(m_tx_amount);
518  return ss.str();
519  }
520 
521  private:
524  };
525  //----------------------------------------------------------------------------------------------------
527  {
529  : transfer_error(std::move(loc), "tx not possible")
532  , m_fee(fee)
533  {
534  }
535 
536  uint64_t available() const { return m_available; }
537  uint64_t tx_amount() const { return m_tx_amount; }
538  uint64_t fee() const { return m_fee; }
539 
541  {
542  std::ostringstream ss;
543  ss << transfer_error::to_string() <<
544  ", available = " << cryptonote::print_money(m_available) <<
545  ", tx_amount = " << cryptonote::print_money(m_tx_amount) <<
546  ", fee = " << cryptonote::print_money(m_fee);
547  return ss.str();
548  }
549 
550  private:
554  };
555  //----------------------------------------------------------------------------------------------------
557  {
558  typedef std::unordered_map<uint64_t, uint64_t> scanty_outs_t;
559 
561  : transfer_error(std::move(loc), "not enough outputs to use")
564  {
565  }
566 
567  const scanty_outs_t& scanty_outs() const { return m_scanty_outs; }
568  size_t mixin_count() const { return m_mixin_count; }
569 
571  {
572  std::ostringstream ss;
573  ss << transfer_error::to_string() << ", ring size = " << (m_mixin_count + 1) << ", scanty_outs:";
574  for (const auto& out: m_scanty_outs)
575  {
576  ss << '\n' << cryptonote::print_money(out.first) << " - " << out.second;
577  }
578  return ss.str();
579  }
580 
581  private:
584  };
585  //----------------------------------------------------------------------------------------------------
587  {
588  typedef std::vector<cryptonote::tx_source_entry> sources_t;
589  typedef std::vector<cryptonote::tx_destination_entry> destinations_t;
590 
592  std::string && loc
593  , sources_t const & sources
594  , destinations_t const & destinations
596  , cryptonote::network_type nettype
597  )
598  : transfer_error(std::move(loc), "transaction was not constructed")
599  , m_sources(sources)
602  , m_nettype(nettype)
603  {
604  }
605 
606  const sources_t& sources() const { return m_sources; }
607  const destinations_t& destinations() const { return m_destinations; }
608  uint64_t unlock_time() const { return m_unlock_time; }
609 
611  {
612  std::ostringstream ss;
614  ss << "\nSources:";
615  for (size_t i = 0; i < m_sources.size(); ++i)
616  {
618  ss << "\n source " << i << ":";
619  ss << "\n amount: " << cryptonote::print_money(src.amount);
620  // It's not good, if logs will contain such much data
621  //ss << "\n real_output: " << src.real_output;
622  //ss << "\n real_output_in_tx_index: " << src.real_output_in_tx_index;
623  //ss << "\n real_out_tx_key: " << epee::string_tools::pod_to_hex(src.real_out_tx_key);
624  //ss << "\n outputs:";
625  //for (size_t j = 0; j < src.outputs.size(); ++j)
626  //{
627  // const cryptonote::tx_source_entry::output_entry& out = src.outputs[j];
628  // ss << "\n " << j << ": " << out.first << ", " << epee::string_tools::pod_to_hex(out.second);
629  //}
630  }
631 
632  ss << "\nDestinations:";
633  for (size_t i = 0; i < m_destinations.size(); ++i)
634  {
636  ss << "\n " << i << ": " << cryptonote::get_account_address_as_str(m_nettype, dst.is_subaddress, dst.addr) << " " <<
638  }
639 
640  ss << "\nunlock_time: " << m_unlock_time;
641 
642  return ss.str();
643  }
644 
645  private:
650  };
651  //----------------------------------------------------------------------------------------------------
652  struct tx_rejected : public transfer_error
653  {
655  : transfer_error(std::move(loc), "transaction was rejected by daemon")
656  , m_tx(tx)
657  , m_status(status)
658  , m_reason(reason)
659  {
660  }
661 
662  const cryptonote::transaction& tx() const { return m_tx; }
663  const std::string& status() const { return m_status; }
664  const std::string& reason() const { return m_reason; }
665 
667  {
668  std::ostringstream ss;
669  ss << transfer_error::to_string() << ", status = " << m_status << ", tx:\n";
672  if (!m_reason.empty())
673  {
674  ss << " (" << m_reason << ")";
675  }
676  return ss.str();
677  }
678 
679  private:
683  };
684  //----------------------------------------------------------------------------------------------------
686  {
687  explicit tx_sum_overflow(
688  std::string && loc
689  , const std::vector<cryptonote::tx_destination_entry>& destinations
690  , uint64_t fee
691  , cryptonote::network_type nettype
692  )
693  : transfer_error(std::move(loc), "transaction sum + fee exceeds " + cryptonote::print_money(std::numeric_limits<uint64_t>::max()))
695  , m_fee(fee)
696  , m_nettype(nettype)
697  {
698  }
699 
700  const std::vector<cryptonote::tx_destination_entry>& destinations() const { return m_destinations; }
701  uint64_t fee() const { return m_fee; }
702 
704  {
705  std::ostringstream ss;
706  ss << transfer_error::to_string() <<
707  ", fee = " << cryptonote::print_money(m_fee) <<
708  ", destinations:";
709  for (const auto& dst : m_destinations)
710  {
711  ss << '\n' << cryptonote::print_money(dst.amount) << " -> " << cryptonote::get_account_address_as_str(m_nettype, dst.is_subaddress, dst.addr);
712  }
713  return ss.str();
714  }
715 
716  private:
717  std::vector<cryptonote::tx_destination_entry> m_destinations;
720  };
721  //----------------------------------------------------------------------------------------------------
722  struct tx_too_big : public transfer_error
723  {
725  : transfer_error(std::move(loc), "transaction is too big")
726  , m_tx(tx)
727  , m_tx_valid(true)
730  {
731  }
732 
734  : transfer_error(std::move(loc), "transaction would be too big")
735  , m_tx_valid(false)
738  {
739  }
740 
741  bool tx_valid() const { return m_tx_valid; }
742  const cryptonote::transaction& tx() const { return m_tx; }
743  uint64_t tx_weight() const { return m_tx_weight; }
745 
747  {
748  std::ostringstream ss;
749  ss << transfer_error::to_string() <<
750  ", tx_weight_limit = " << m_tx_weight_limit <<
751  ", tx weight = " << m_tx_weight;
752  if (m_tx_valid)
753  {
755  ss << ", tx:\n" << cryptonote::obj_to_json_str(tx);
756  }
757  return ss.str();
758  }
759 
760  private:
765  };
766  //----------------------------------------------------------------------------------------------------
768  {
769  explicit zero_amount(std::string&& loc)
770  : transfer_error(std::move(loc), "destination amount is zero")
771  {
772  }
773  };
774  //----------------------------------------------------------------------------------------------------
776  {
778  : transfer_error(std::move(loc), "transaction has no destination")
779  {
780  }
781  };
782  //----------------------------------------------------------------------------------------------------
784  {
785  explicit subtract_fee_from_bad_index(std::string&& loc, long bad_index)
786  : transfer_error(std::move(loc),
787  "subtractfeefrom: bad index: " + std::to_string(bad_index) + " (indexes are 0-based)")
788  {
789  }
790  };
791  //----------------------------------------------------------------------------------------------------
793  {
794  const std::string& request() const { return m_request; }
795 
797  {
798  std::ostringstream ss;
799  ss << wallet_logic_error::to_string() << ", request = " << m_request;
800  return ss.str();
801  }
802 
803  protected:
806  , m_request(request)
807  {
808  }
809 
810  private:
812  };
813  //----------------------------------------------------------------------------------------------------
815  {
817  : wallet_rpc_error(std::move(loc), std::string("error in ") + request + " RPC: " + status, request),
819  {
820  }
821  const std::string& status() const { return m_status; }
822  private:
824  };
825  //----------------------------------------------------------------------------------------------------
827  {
829  : wallet_rpc_error(std::move(loc), std::string("error ") + std::to_string(code) + (" in ") + request + " RPC: " + status, request),
831  {
832  }
833  int code() const { return m_code; }
834  const std::string& status() const { return m_status; }
835  private:
836  int m_code;
838  };
839  //----------------------------------------------------------------------------------------------------
841  {
842  explicit daemon_busy(std::string&& loc, const std::string& request)
843  : wallet_rpc_error(std::move(loc), "daemon is busy", request)
844  {
845  }
846  };
847  //----------------------------------------------------------------------------------------------------
849  {
851  : wallet_rpc_error(std::move(loc), "no connection to daemon", request)
852  {
853  }
854  };
855  //----------------------------------------------------------------------------------------------------
857  {
859  : wallet_rpc_error(std::move(loc), "error from is_key_image_spent call", request)
860  {
861  }
862  };
863  //----------------------------------------------------------------------------------------------------
865  {
867  : wallet_rpc_error(std::move(loc), "failed to get output histogram", request)
868  {
869  }
870  };
871  //----------------------------------------------------------------------------------------------------
873  {
875  : wallet_rpc_error(std::move(loc), "failed to get output distribution", request)
876  {
877  }
878  };
879  //----------------------------------------------------------------------------------------------------
881  {
883  : wallet_rpc_error(std::move(loc), "payment required", request)
884  {
885  }
886  };
887  //----------------------------------------------------------------------------------------------------
889  {
891  : wallet_logic_error(std::move(loc), "file " + wallet_file + " does not correspond to " + keys_file)
892  {
893  }
894 
895  const std::string& keys_file() const { return m_keys_file; }
896  const std::string& wallet_file() const { return m_wallet_file; }
897 
899 
900  private:
903  };
904  //----------------------------------------------------------------------------------------------------
906  {
907  protected:
908  explicit mms_error(std::string&& loc, const std::string& message)
910  {
911  }
912  };
913  //----------------------------------------------------------------------------------------------------
915  {
917  : mms_error(std::move(loc), "no connection to PyBitmessage at address " + address)
918  {
919  }
920  };
921  //----------------------------------------------------------------------------------------------------
923  {
924  explicit bitmessage_api_error(std::string&& loc, const std::string& error_string)
925  : mms_error(std::move(loc), "PyBitmessage returned " + error_string)
926  {
927  }
928  };
929  //----------------------------------------------------------------------------------------------------
931  {
932  protected:
935  {
936  }
937  };
938  //----------------------------------------------------------------------------------------------------
940  {
942  : scan_tx_error(std::move(loc), "The wallet has already seen 1 or more recent transactions than the scanned tx")
943  {
944  }
945  };
946  //----------------------------------------------------------------------------------------------------
947 
948 #if !defined(_MSC_VER)
949 
950  template<typename TException, typename... TArgs>
951  void throw_wallet_ex(std::string&& loc, const TArgs&... args)
952  {
953  TException e(std::move(loc), args...);
954  LOG_PRINT_L0(e.to_string());
955  throw e;
956  }
957 
958 #else
959  #include <boost/preprocessor/repetition/enum_binary_params.hpp>
960  #include <boost/preprocessor/repetition/enum_params.hpp>
961  #include <boost/preprocessor/repetition/repeat_from_to.hpp>
962 
963  template<typename TException>
964  void throw_wallet_ex(std::string&& loc)
965  {
966  TException e(std::move(loc));
967  LOG_PRINT_L0(e.to_string());
968  throw e;
969  }
970 
971 #define GEN_throw_wallet_ex(z, n, data) \
972  template<typename TException, BOOST_PP_ENUM_PARAMS(n, typename TArg)> \
973  void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \
974  { \
975  TException e(std::move(loc), BOOST_PP_ENUM_PARAMS(n, arg)); \
976  LOG_PRINT_L0(e.to_string()); \
977  throw e; \
978  }
979 
980  BOOST_PP_REPEAT_FROM_TO(1, 6, GEN_throw_wallet_ex, ~)
981 #endif
982  }
983 }
984 
985 #define STRINGIZE_DETAIL(x) #x
986 #define STRINGIZE(x) STRINGIZE_DETAIL(x)
987 
988 #define THROW_WALLET_EXCEPTION(err_type, ...) \
989  do { \
990  LOG_ERROR("THROW EXCEPTION: " << #err_type); \
991  tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
992  } while(0)
993 
994 #define THROW_WALLET_EXCEPTION_IF(cond, err_type, ...) \
995  if (cond) \
996  { \
997  LOG_ERROR(#cond << ". THROW EXCEPTION: " << #err_type); \
998  tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
999  }
Definition: wallet_errors.h:792
Definition: wallet_errors.h:245
Definition: wallet_errors.h:586
is_key_image_spent_error(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:858
subtract_fee_from_bad_index(std::string &&loc, long bad_index)
Definition: wallet_errors.h:785
no_connection_to_daemon(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:850
std::string to_string() const
Definition: wallet_errors.h:442
Definition: wallet_errors.h:848
uint64_t tx_weight() const
Definition: wallet_errors.h:743
wallet_rpc_error(std::string &&loc, const std::string &message, const std::string &request)
Definition: wallet_errors.h:804
password_needed(std::string &&loc, const std::string &msg="Password needed")
Definition: wallet_errors.h:221
std::string m_loc
Definition: wallet_errors.h:123
Definition: wallet_errors.h:317
Definition: wallet_errors.h:556
uint64_t m_fee
Definition: wallet_errors.h:553
Definition: wallet_errors.h:922
std::string get_account_address_as_str(network_type nettype, bool subaddress, account_public_address const &adr)
Definition: cryptonote_basic_impl.cpp:150
std::string m_status
Definition: wallet_errors.h:681
const std::string & request() const
Definition: wallet_errors.h:794
cryptonote::network_type m_nettype
Definition: wallet_errors.h:719
Definition: wallet_errors.h:134
wallet_error_base< std::runtime_error > wallet_runtime_error
Definition: wallet_errors.h:163
const std::string & file() const
Definition: wallet_errors.h:264
uint64_t tx_weight_limit() const
Definition: wallet_errors.h:744
Definition: wallet_errors.h:399
uint64_t m_available
Definition: wallet_errors.h:496
int i
Definition: pymoduletest.py:23
bool m_tx_valid
Definition: wallet_errors.h:762
Definition: wallet_errors.h:425
const cryptonote::account_keys & acc_keys() const
Definition: wallet_errors.h:361
uint64_t m_tx_amount
Definition: wallet_errors.h:552
Definition: wallet_errors.h:243
void throw_wallet_ex(std::string &&loc, const TArgs &... args)
Definition: wallet_errors.h:951
int m_code
Definition: wallet_errors.h:836
std::string to_string() const
Definition: wallet_errors.h:666
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:359
::std::string string
Definition: gtest-port.h:1097
Definition: wallet_errors.h:333
uint64_t m_tx_weight
Definition: wallet_errors.h:763
Definition: wallet_errors.h:340
wallet_generic_rpc_error(std::string &&loc, const std::string &request, const std::string &status)
Definition: wallet_errors.h:816
tx_parse_error(std::string &&loc, const cryptonote::blobdata &tx_blob)
Definition: wallet_errors.h:401
std::string m_keys_file
Definition: wallet_errors.h:901
not_enough_money(std::string &&loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:502
Definition: wallet_errors.h:250
uint64_t tx_amount() const
Definition: wallet_errors.h:537
Definition: wallet_errors.h:880
Definition: wallet_errors.h:141
block_parse_error(std::string &&loc, const cryptonote::blobdata &block_data)
Definition: wallet_errors.h:379
Definition: wallet_errors.h:326
std::vector< cryptonote::tx_destination_entry > destinations_t
Definition: wallet_errors.h:589
std::vector< cryptonote::tx_destination_entry > m_destinations
Definition: wallet_errors.h:717
transfer_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:466
zero_amount(std::string &&loc)
Definition: wallet_errors.h:769
index_outofbound(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:328
uint64_t fee() const
Definition: wallet_errors.h:701
std::string to_string() const
Definition: wallet_errors.h:512
std::string to_string() const
Definition: wallet_errors.h:610
failed_rpc_request< transfer_error, get_outs_error_message_index > get_outs_error
Definition: wallet_errors.h:472
no_connection_to_bitmessage(std::string &&loc, const std::string &address)
Definition: wallet_errors.h:916
Definition: enums.h:67
std::string to_string() const
Definition: wallet_errors.h:746
Definition: wallet_errors.h:783
bitmessage_api_error(std::string &&loc, const std::string &error_string)
Definition: wallet_errors.h:924
Definition: wallet_errors.h:173
Definition: wallet_errors.h:455
Definition: wallet_errors.h:914
Definition: wallet_errors.h:722
cryptonote::transaction m_tx
Definition: wallet_errors.h:680
std::unordered_map< uint64_t, uint64_t > scanty_outs_t
Definition: wallet_errors.h:558
uint64_t get_transaction_weight(const transaction &tx, size_t blob_size)
Definition: cryptonote_format_utils.cpp:444
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:350
uint64_t amount
Definition: cryptonote_tx_utils.h:51
address_index_outofbound(std::string &&loc)
Definition: wallet_errors.h:342
Definition: wallet_errors.h:814
args
Definition: build_protob.py:10
uint64_t m_available
Definition: wallet_errors.h:522
uint64_t m_tx_weight_limit
Definition: wallet_errors.h:764
std::string m_file
Definition: wallet_errors.h:269
uint64_t fee() const
Definition: wallet_errors.h:538
tx_not_possible(std::string &&loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:528
const destinations_t & destinations() const
Definition: wallet_errors.h:607
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:687
const cryptonote::blobdata & block_blob() const
Definition: wallet_errors.h:385
Definition: wallet_errors.h:474
const char *const failed_rpc_request_messages[]
Definition: wallet_errors.h:126
multisig_export_needed(std::string &&loc)
Definition: wallet_errors.h:205
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:44
cryptonote::transaction m_tx
Definition: wallet_errors.h:192
e
Definition: pymoduletest.py:79
Definition: wallet_errors.h:826
std::string to_string() const
Definition: wallet_errors.h:284
out_of_hashchain_bounds_error(std::string &&loc)
Definition: wallet_errors.h:427
uint64_t m_available
Definition: wallet_errors.h:551
Definition: wallet_errors.h:864
size_t m_mixin_count
Definition: wallet_errors.h:583
Definition: wallet_errors.h:203
invalid_pregenerated_random(std::string &&loc)
Definition: wallet_errors.h:309
Definition: wallet_errors.h:526
const std::string & keys_file() const
Definition: wallet_errors.h:895
std::string to_string() const
Definition: wallet_errors.h:108
file_error_base< file_save_error_message_index > file_save_error
Definition: wallet_errors.h:275
std::string to_string() const
Definition: wallet_errors.h:486
file_error_base< file_not_found_message_index > file_not_found
Definition: wallet_errors.h:273
Definition: wallet_errors.h:888
Definition: wallet_errors.h:165
Various Tools.
Definition: apply_permutation.h:39
invalid_priority(std::string &&loc)
Definition: wallet_errors.h:288
Definition: wallet_errors.h:277
failed_rpc_request< refresh_error, get_hashes_error_message_index > get_hashes_error
Definition: wallet_errors.h:395
cryptonote::blobdata m_tx_blob
Definition: wallet_errors.h:412
Definition: wallet_errors.h:856
get_output_distribution(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:874
const crypto::public_key & tx_pub_key() const
Definition: wallet_errors.h:360
std::string to_string() const
Definition: wallet_errors.h:303
Definition: cryptonote_tx_utils.h:42
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:742
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:181
account_index_outofbound(std::string &&loc)
Definition: wallet_errors.h:335
invalid_multisig_seed(std::string &&loc)
Definition: wallet_errors.h:298
refresh_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:320
Definition: wallet_errors.h:307
std::string obj_to_json_str(T &obj)
Definition: cryptonote_format_utils.h:205
unsigned __int64 uint64_t
Definition: stdint.h:136
file_error_base< file_read_error_message_index > file_read_error
Definition: wallet_errors.h:274
std::string to_string() const
Definition: wallet_errors.h:151
wont_reprocess_recent_txs_via_untrusted_daemon(std::string &&loc)
Definition: wallet_errors.h:941
daemon_busy(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:842
std::string to_string() const
Definition: wallet_errors.h:387
Definition: wallet_errors.h:227
std::string m_wallet_file
Definition: wallet_errors.h:902
uint64_t amount
Definition: cryptonote_tx_utils.h:77
const scanty_outs_t & scanty_outs() const
Definition: wallet_errors.h:567
not_enough_outs_to_mix(std::string &&loc, const scanty_outs_t &scanty_outs, size_t mixin_count)
Definition: wallet_errors.h:560
sources_t m_sources
Definition: wallet_errors.h:646
const std::string & status() const
Definition: wallet_errors.h:149
#define false
Definition: stdbool.h:37
get_tx_pool_error(std::string &&loc)
Definition: wallet_errors.h:417
Definition: wallet_errors.h:463
const cryptonote::account_keys m_acc_keys
Definition: wallet_errors.h:374
uint64_t available() const
Definition: wallet_errors.h:536
bool is_subaddress
Definition: cryptonote_tx_utils.h:79
Definition: account.h:40
get_histogram_error(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:866
std::string to_string() const
Definition: wallet_errors.h:363
zero_destination(std::string &&loc)
Definition: wallet_errors.h:777
std::string to_string() const
Definition: wallet_errors.h:422
Definition: wallet_errors.h:435
std::string to_string() const
Definition: wallet_errors.h:432
scan_tx_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:933
POD_CLASS public_key
Definition: crypto.h:61
std::string m_reason
Definition: wallet_errors.h:682
const std::string & status() const
Definition: wallet_errors.h:834
wallet_error_base< std::logic_error > wallet_logic_error
Definition: wallet_errors.h:162
size_t mixin_count() const
Definition: wallet_errors.h:568
tx_rejected(std::string &&loc, const cryptonote::transaction &tx, const std::string &status, const std::string &reason)
Definition: wallet_errors.h:654
uint64_t m_tx_amount
Definition: wallet_errors.h:497
std::string m_request
Definition: wallet_errors.h:811
wallet_error_base(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:116
wallet_coded_rpc_error(std::string &&loc, const std::string &request, int code, const std::string &status)
Definition: wallet_errors.h:828
Definition: wallet_errors.h:244
std::string to_string() const
Definition: wallet_errors.h:314
Definition: wallet_errors.h:104
const std::string & reason() const
Definition: wallet_errors.h:664
mms_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:908
not_enough_unlocked_money(std::string &&loc, uint64_t available, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:476
account_public_address addr
Definition: cryptonote_tx_utils.h:78
std::string blobdata
Definition: blobdatatype.h:39
std::string to_string() const
Definition: wallet_errors.h:570
Definition: get_output_distribution.py:1
uint64_t tx_amount() const
Definition: wallet_errors.h:510
const std::string & location() const
Definition: wallet_errors.h:106
std::string to_string() const
Definition: wallet_errors.h:452
network_type
Definition: cryptonote_config.h:295
uint32_t address
Definition: getifaddr.c:269
Definition: wallet_errors.h:195
const crypto::public_key m_tx_pub_key
Definition: wallet_errors.h:373
Definition: wallet_errors.h:775
Definition: wallet_errors.h:840
std::string to_string() const
Definition: wallet_errors.h:409
tx_too_big(std::string &&loc, uint64_t tx_weight, uint64_t tx_weight_limit)
Definition: wallet_errors.h:733
Definition: wallet_errors.h:500
const T & move(const T &t)
Definition: gtest-port.h:1317
const cryptonote::blobdata & tx_blob() const
Definition: wallet_errors.h:407
Definition: wallet_errors.h:219
failed_rpc_request(std::string &&loc, const std::string &status)
Definition: wallet_errors.h:143
password_entry_failed(std::string &&loc, const std::string &msg="Password entry failed")
Definition: wallet_errors.h:229
const std::string & status() const
Definition: wallet_errors.h:663
const std::string & wallet_file() const
Definition: wallet_errors.h:896
wallet_internal_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:167
cryptonote::network_type m_nettype
Definition: wallet_errors.h:649
wallet_files_doesnt_correspond(std::string &&loc, const std::string &keys_file, const std::string &wallet_file)
Definition: wallet_errors.h:890
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:591
incorrect_fork_version(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:447
Definition: wallet_errors.h:211
Definition: wallet_errors.h:137
std::string to_string() const
Definition: wallet_errors.h:898
Definition: wallet_errors.h:286
cryptonote::blobdata m_block_blob
Definition: wallet_errors.h:390
std::string to_string() const
Definition: wallet_errors.h:540
const std::vector< cryptonote::tx_destination_entry > & destinations() const
Definition: wallet_errors.h:700
std::string to_string() const
Definition: wallet_errors.h:703
Definition: wallet_errors.h:296
std::string m_status
Definition: wallet_errors.h:159
Definition: cryptonote_tx_utils.h:74
int code() const
Definition: wallet_errors.h:833
uint64_t m_tx_amount
Definition: wallet_errors.h:523
uint64_t m_fee
Definition: wallet_errors.h:718
std::string to_string() const
Definition: wallet_errors.h:796
bool tx_valid() const
Definition: wallet_errors.h:741
failed_rpc_request< refresh_error, get_blocks_error_message_index > get_blocks_error
Definition: wallet_errors.h:393
std::string to_string() const
Definition: wallet_errors.h:183
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:662
std::vector< cryptonote::tx_source_entry > sources_t
Definition: wallet_errors.h:588
multisig_import_needed(std::string &&loc)
Definition: wallet_errors.h:213
Definition: wallet_errors.h:652
payment_required(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:882
scanty_outs_t m_scanty_outs
Definition: wallet_errors.h:582
signature_check_failed(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:457
Definition: wallet_errors.h:135
failed_rpc_request< refresh_error, get_out_indices_error_message_index > get_out_indices_error
Definition: wallet_errors.h:397
uint64_t available() const
Definition: wallet_errors.h:483
failed_rpc_request_message_indices
Definition: wallet_errors.h:132
cryptonote::transaction m_tx
Definition: wallet_errors.h:761
std::string to_string(t_connection_type type)
Definition: connection_basic.cpp:76
Definition: wallet_errors.h:930
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:1166
uint64_t m_unlock_time
Definition: wallet_errors.h:648
const std::string m_status
Definition: wallet_errors.h:837
const cryptonote::transaction m_tx
Definition: wallet_errors.h:372
const std::string & status() const
Definition: wallet_errors.h:821
file_error_base(std::string &&loc, const std::string &file)
Definition: wallet_errors.h:252
file_error_message_indices
Definition: wallet_errors.h:241
unexpected_txin_type(std::string &&loc, const cryptonote::transaction &tx)
Definition: wallet_errors.h:175
Definition: wallet_errors.h:348
wallet_not_initialized(std::string &&loc)
Definition: wallet_errors.h:197
uint64_t available() const
Definition: wallet_errors.h:509
destinations_t m_destinations
Definition: wallet_errors.h:647
uint64_t unlock_time() const
Definition: wallet_errors.h:608
std::string to_string() const
Definition: wallet_errors.h:293
invalid_password(std::string &&loc)
Definition: wallet_errors.h:279
error
Tracks LMDB error codes.
Definition: error.h:44
tuple message
Definition: gtest_output_test.py:331
Definition: wallet_errors.h:767
file_error_base< file_exists_message_index > file_exists
Definition: wallet_errors.h:272
Definition: cryptonote_basic.h:204
#define true
Definition: stdbool.h:36
std::string to_string() const
Definition: wallet_errors.h:266
Definition: wallet_errors.h:685
Definition: wallet_errors.h:246
Definition: wallet_errors.h:415
reorg_depth_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:437
Definition: wallet_errors.h:377
const std::string m_status
Definition: wallet_errors.h:823
Definition: wallet_errors.h:905
const char *const file_error_messages[]
Definition: wallet_errors.h:235
uint64_t tx_amount() const
Definition: wallet_errors.h:484
Definition: wallet_errors.h:445
tx_too_big(std::string &&loc, const cryptonote::transaction &tx, uint64_t tx_weight_limit)
Definition: wallet_errors.h:724
const sources_t & sources() const
Definition: wallet_errors.h:606