Electroneum
wallet_errors.h
Go to the documentation of this file.
1 // Copyrights(c) 2017-2019, The Electroneum Project
2 // Copyrights(c) 2014-2017, The Monero Project
3 //
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without modification, are
7 // permitted provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code must retain the above copyright notice, this list of
10 // conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
13 // of conditions and the following disclaimer in the documentation and/or other
14 // materials provided with the distribution.
15 //
16 // 3. Neither the name of the copyright holder nor the names of its contributors may be
17 // used to endorse or promote products derived from this software without specific
18 // prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31 
32 #pragma once
33 
34 #include <stdexcept>
35 #include <system_error>
36 #include <string>
37 #include <vector>
38 
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  // std::logic_error
55  // wallet_logic_error *
56  // file_exists
57  // file_not_found
58  // file_read_error
59  // file_save_error
60  // invalid_password
61  // invalid_priority
62  // refresh_error *
63  // acc_outs_lookup_error
64  // block_parse_error
65  // get_blocks_error
66  // get_hashes_error
67  // get_out_indexes_error
68  // tx_parse_error
69  // get_tx_pool_error
70  // transfer_error *
71  // get_random_outs_general_error
72  // not_enough_money
73  // tx_not_possible
74  // not_enough_outs_to_mix
75  // tx_not_constructed
76  // tx_rejected
77  // tx_sum_overflow
78  // tx_too_big
79  // zero_destination
80  // wallet_rpc_error *
81  // daemon_busy
82  // no_connection_to_daemon
83  // is_key_image_spent_error
84  // get_histogram_error
85  // wallet_files_doesnt_correspond
86  //
87  // * - class with protected ctor
88 
89  //----------------------------------------------------------------------------------------------------
90  template<typename Base>
91  struct wallet_error_base : public Base
92  {
93  const std::string& location() const { return m_loc; }
94 
95  std::string to_string() const
96  {
97  std::ostringstream ss;
98  ss << m_loc << ':' << typeid(*this).name() << ": " << Base::what();
99  return ss.str();
100  }
101 
102  protected:
103  wallet_error_base(std::string&& loc, const std::string& message)
104  : Base(message)
105  , m_loc(loc)
106  {
107  }
108 
109  private:
110  std::string m_loc;
111  };
112  //----------------------------------------------------------------------------------------------------
113  const char* const failed_rpc_request_messages[] = {
114  "failed to get blocks",
115  "failed to get hashes",
116  "failed to get out indices",
117  "failed to get random outs"
118  };
120  {
125  };
126 
127  template<typename Base, int msg_index>
128  struct failed_rpc_request : public Base
129  {
130  explicit failed_rpc_request(std::string&& loc, const std::string& status)
131  : Base(std::move(loc), failed_rpc_request_messages[msg_index])
132  , m_status(status)
133  {
134  }
135 
136  const std::string& status() const { return m_status; }
137 
138  std::string to_string() const
139  {
140  std::ostringstream ss;
141  ss << Base::to_string() << ", status = " << status();
142  return ss.str();
143  }
144 
145  private:
146  std::string m_status;
147  };
148  //----------------------------------------------------------------------------------------------------
151  //----------------------------------------------------------------------------------------------------
153  {
154  explicit wallet_internal_error(std::string&& loc, const std::string& message)
155  : wallet_runtime_error(std::move(loc), message)
156  {
157  }
158  };
159  //----------------------------------------------------------------------------------------------------
161  {
162  explicit unexpected_txin_type(std::string&& loc, const cryptonote::transaction& tx)
163  : wallet_internal_error(std::move(loc), "one of tx inputs has unexpected type")
164  , m_tx(tx)
165  {
166  }
167 
168  const cryptonote::transaction& tx() const { return m_tx; }
169 
170  std::string to_string() const
171  {
172  std::ostringstream ss;
175  return ss.str();
176  }
177 
178  private:
180  };
181  //----------------------------------------------------------------------------------------------------
183  {
184  explicit wallet_not_initialized(std::string&& loc)
185  : wallet_internal_error(std::move(loc), "wallet is not initialized")
186  {
187  }
188  };
189 
190  //----------------------------------------------------------------------------------------------------
191  const char* const file_error_messages[] = {
192  "file already exists",
193  "file not found",
194  "failed to read file",
195  "failed to save file"
196  };
198  {
203  };
204 
205  template<int msg_index>
207  {
208  explicit file_error_base(std::string&& loc, const std::string& file)
209  : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + '\"')
210  , m_file(file)
211  {
212  }
213 
214  explicit file_error_base(std::string&& loc, const std::string& file, const std::error_code &e)
215  : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + "\": " + e.message())
216  , m_file(file)
217  {
218  }
219 
220  const std::string& file() const { return m_file; }
221 
222  std::string to_string() const { return wallet_logic_error::to_string(); }
223 
224  private:
225  std::string m_file;
226  };
227  //----------------------------------------------------------------------------------------------------
232  //----------------------------------------------------------------------------------------------------
234  {
235  explicit invalid_password(std::string&& loc)
236  : wallet_logic_error(std::move(loc), "invalid password")
237  {
238  }
239 
240  std::string to_string() const { return wallet_logic_error::to_string(); }
241  };
243  {
244  explicit invalid_priority(std::string&& loc)
245  : wallet_logic_error(std::move(loc), "invalid priority")
246  {
247  }
248 
249  std::string to_string() const { return wallet_logic_error::to_string(); }
250  };
251 
252  //----------------------------------------------------------------------------------------------------
254  {
255  explicit invalid_pregenerated_random (std::string&& loc)
256  : wallet_logic_error(std::move(loc), "invalid pregenerated random for wallet creation/recovery")
257  {
258  }
259 
260  std::string to_string() const { return wallet_logic_error::to_string(); }
261  };
262  //----------------------------------------------------------------------------------------------------
264  {
265  protected:
266  explicit refresh_error(std::string&& loc, const std::string& message)
267  : wallet_logic_error(std::move(loc), message)
268  {
269  }
270  };
271  //----------------------------------------------------------------------------------------------------
273  {
274  explicit acc_outs_lookup_error(std::string&& loc, const cryptonote::transaction& tx,
276  : refresh_error(std::move(loc), "account outs lookup error")
277  , m_tx(tx)
280  {
281  }
282 
283  const cryptonote::transaction& tx() const { return m_tx; }
284  const crypto::public_key& tx_pub_key() const { return m_tx_pub_key; }
285  const cryptonote::account_keys& acc_keys() const { return m_acc_keys; }
286 
287  std::string to_string() const
288  {
289  std::ostringstream ss;
292  return ss.str();
293  }
294 
295  private:
299  };
300  //----------------------------------------------------------------------------------------------------
302  {
303  explicit block_parse_error(std::string&& loc, const cryptonote::blobdata& block_data)
304  : refresh_error(std::move(loc), "block parse error")
305  , m_block_blob(block_data)
306  {
307  }
308 
309  const cryptonote::blobdata& block_blob() const { return m_block_blob; }
310 
311  std::string to_string() const { return refresh_error::to_string(); }
312 
313  private:
315  };
316  //----------------------------------------------------------------------------------------------------
318  //----------------------------------------------------------------------------------------------------
320  //----------------------------------------------------------------------------------------------------
322  //----------------------------------------------------------------------------------------------------
324  {
325  explicit tx_parse_error(std::string&& loc, const cryptonote::blobdata& tx_blob)
326  : refresh_error(std::move(loc), "transaction parse error")
327  , m_tx_blob(tx_blob)
328  {
329  }
330 
331  const cryptonote::blobdata& tx_blob() const { return m_tx_blob; }
332 
333  std::string to_string() const { return refresh_error::to_string(); }
334 
335  private:
337  };
338  //----------------------------------------------------------------------------------------------------
340  {
341  explicit get_tx_pool_error(std::string&& loc)
342  : refresh_error(std::move(loc), "error getting tranaction pool")
343  {
344  }
345 
346  std::string to_string() const { return refresh_error::to_string(); }
347  };
348  //----------------------------------------------------------------------------------------------------
350  {
351  protected:
352  explicit transfer_error(std::string&& loc, const std::string& message)
353  : wallet_logic_error(std::move(loc), message)
354  {
355  }
356  };
357  //----------------------------------------------------------------------------------------------------
359  //----------------------------------------------------------------------------------------------------
361  {
362  explicit not_enough_money(std::string&& loc, uint64_t availbable, uint64_t tx_amount, uint64_t fee)
363  : transfer_error(std::move(loc), "not enough money")
364  , m_available(availbable)
366  {
367  }
368 
369  uint64_t available() const { return m_available; }
370  uint64_t tx_amount() const { return m_tx_amount; }
371 
372  std::string to_string() const
373  {
374  std::ostringstream ss;
375  ss << transfer_error::to_string() <<
376  ", available = " << cryptonote::print_money(m_available) <<
377  ", tx_amount = " << cryptonote::print_money(m_tx_amount);
378  return ss.str();
379  }
380 
381  private:
382  uint64_t m_available;
383  uint64_t m_tx_amount;
384  };
385  //----------------------------------------------------------------------------------------------------
387  {
388  explicit tx_not_possible(std::string&& loc, uint64_t availbable, uint64_t tx_amount, uint64_t fee)
389  : transfer_error(std::move(loc), "tx not possible")
390  , m_available(availbable)
392  , m_fee(fee)
393  {
394  }
395 
396  uint64_t available() const { return m_available; }
397  uint64_t tx_amount() const { return m_tx_amount; }
398  uint64_t fee() const { return m_fee; }
399 
400  std::string to_string() const
401  {
402  std::ostringstream ss;
403  ss << transfer_error::to_string() <<
404  ", available = " << cryptonote::print_money(m_available) <<
405  ", tx_amount = " << cryptonote::print_money(m_tx_amount) <<
406  ", fee = " << cryptonote::print_money(m_fee);
407  return ss.str();
408  }
409 
410  private:
411  uint64_t m_available;
412  uint64_t m_tx_amount;
413  uint64_t m_fee;
414  };
415  //----------------------------------------------------------------------------------------------------
417  {
418  typedef std::unordered_map<uint64_t, uint64_t> scanty_outs_t;
419 
420  explicit not_enough_outs_to_mix(std::string&& loc, const scanty_outs_t& scanty_outs, size_t mixin_count)
421  : transfer_error(std::move(loc), "not enough outputs to use")
424  {
425  }
426 
427  const scanty_outs_t& scanty_outs() const { return m_scanty_outs; }
428  size_t mixin_count() const { return m_mixin_count; }
429 
430  std::string to_string() const
431  {
432  std::ostringstream ss;
433  ss << transfer_error::to_string() << "scanty_outs:";
434  for (const auto& out: m_scanty_outs)
435  {
436  ss << '\n' << cryptonote::print_money(out.first) << " - " << out.second;
437  }
438  return ss.str();
439  }
440 
441  private:
444  };
445  //----------------------------------------------------------------------------------------------------
447  {
448  typedef std::vector<cryptonote::tx_source_entry> sources_t;
449  typedef std::vector<cryptonote::tx_destination_entry> destinations_t;
450 
452  std::string && loc
453  , sources_t const & sources
454  , destinations_t const & destinations
455  , uint64_t unlock_time
456  , bool testnet
457  )
458  : transfer_error(std::move(loc), "transaction was not constructed")
459  , m_sources(sources)
462  , m_testnet(testnet)
463  {
464  }
465 
466  const sources_t& sources() const { return m_sources; }
467  const destinations_t& destinations() const { return m_destinations; }
468  uint64_t unlock_time() const { return m_unlock_time; }
469 
470  std::string to_string() const
471  {
472  std::ostringstream ss;
474  ss << "\nSources:";
475  for (size_t i = 0; i < m_sources.size(); ++i)
476  {
477  const cryptonote::tx_source_entry& src = m_sources[i];
478  ss << "\n source " << i << ":";
479  ss << "\n amount: " << cryptonote::print_money(src.amount);
480  // It's not good, if logs will contain such much data
481  //ss << "\n real_output: " << src.real_output;
482  //ss << "\n real_output_in_tx_index: " << src.real_output_in_tx_index;
483  //ss << "\n real_out_tx_key: " << epee::string_tools::pod_to_hex(src.real_out_tx_key);
484  //ss << "\n outputs:";
485  //for (size_t j = 0; j < src.outputs.size(); ++j)
486  //{
487  // const cryptonote::tx_source_entry::output_entry& out = src.outputs[j];
488  // ss << "\n " << j << ": " << out.first << ", " << epee::string_tools::pod_to_hex(out.second);
489  //}
490  }
491 
492  ss << "\nDestinations:";
493  for (size_t i = 0; i < m_destinations.size(); ++i)
494  {
496  ss << "\n " << i << ": " << cryptonote::get_account_address_as_str(m_testnet, dst.addr) << " " <<
498  }
499 
500  ss << "\nunlock_time: " << m_unlock_time;
501 
502  return ss.str();
503  }
504 
505  private:
508  uint64_t m_unlock_time;
509  bool m_testnet;
510  };
511  //----------------------------------------------------------------------------------------------------
512  struct tx_rejected : public transfer_error
513  {
514  explicit tx_rejected(std::string&& loc, const cryptonote::transaction& tx, const std::string& status, const std::string& reason)
515  : transfer_error(std::move(loc), "transaction was rejected by daemon")
516  , m_tx(tx)
517  , m_status(status)
518  , m_reason(reason)
519  {
520  }
521 
522  const cryptonote::transaction& tx() const { return m_tx; }
523  const std::string& status() const { return m_status; }
524  const std::string& reason() const { return m_reason; }
525 
526  std::string to_string() const
527  {
528  std::ostringstream ss;
529  ss << transfer_error::to_string() << ", status = " << m_status << ", tx:\n";
532  if (!m_reason.empty())
533  {
534  ss << " (" << m_reason << ")";
535  }
536  return ss.str();
537  }
538 
539  private:
541  std::string m_status;
542  std::string m_reason;
543  };
544  //----------------------------------------------------------------------------------------------------
546  {
547  explicit tx_sum_overflow(
548  std::string && loc
549  , const std::vector<cryptonote::tx_destination_entry>& destinations
550  , uint64_t fee
551  , bool testnet
552  )
553  : transfer_error(std::move(loc), "transaction sum + fee exceeds " + cryptonote::print_money(std::numeric_limits<uint64_t>::max()))
555  , m_fee(fee)
556  , m_testnet(testnet)
557  {
558  }
559 
560  const std::vector<cryptonote::tx_destination_entry>& destinations() const { return m_destinations; }
561  uint64_t fee() const { return m_fee; }
562 
563  std::string to_string() const
564  {
565  std::ostringstream ss;
566  ss << transfer_error::to_string() <<
567  ", fee = " << cryptonote::print_money(m_fee) <<
568  ", destinations:";
569  for (const auto& dst : m_destinations)
570  {
571  ss << '\n' << cryptonote::print_money(dst.amount) << " -> " << cryptonote::get_account_address_as_str(m_testnet, dst.addr);
572  }
573  return ss.str();
574  }
575 
576  private:
577  std::vector<cryptonote::tx_destination_entry> m_destinations;
578  uint64_t m_fee;
579  bool m_testnet;
580  };
581  //----------------------------------------------------------------------------------------------------
582  struct tx_too_big : public transfer_error
583  {
584  explicit tx_too_big(std::string&& loc, const cryptonote::transaction& tx, uint64_t tx_size_limit)
585  : transfer_error(std::move(loc), "transaction is too big")
586  , m_tx(tx)
588  {
589  }
590 
591  const cryptonote::transaction& tx() const { return m_tx; }
592  uint64_t tx_size_limit() const { return m_tx_size_limit; }
593 
594  std::string to_string() const
595  {
596  std::ostringstream ss;
598  ss << transfer_error::to_string() <<
599  ", tx_size_limit = " << m_tx_size_limit <<
600  ", tx size = " << get_object_blobsize(m_tx) <<
601  ", tx:\n" << cryptonote::obj_to_json_str(tx);
602  return ss.str();
603  }
604 
605  private:
607  uint64_t m_tx_size_limit;
608  };
609  //----------------------------------------------------------------------------------------------------
611  {
612  explicit zero_destination(std::string&& loc)
613  : transfer_error(std::move(loc), "destination amount is zero")
614  {
615  }
616  };
617  //----------------------------------------------------------------------------------------------------
619  {
620  const std::string& request() const { return m_request; }
621 
622  std::string to_string() const
623  {
624  std::ostringstream ss;
625  ss << wallet_logic_error::to_string() << ", request = " << m_request;
626  return ss.str();
627  }
628 
629  protected:
630  explicit wallet_rpc_error(std::string&& loc, const std::string& message, const std::string& request)
631  : wallet_logic_error(std::move(loc), message)
632  , m_request(request)
633  {
634  }
635 
636  private:
637  std::string m_request;
638  };
639  //----------------------------------------------------------------------------------------------------
641  {
642  explicit wallet_generic_rpc_error(std::string&& loc, const std::string& request, const std::string& status)
643  : wallet_rpc_error(std::move(loc), std::string("error in ") + request + " RPC: " + status, request),
645  {
646  }
647  const std::string& status() const { return m_status; }
648  private:
649  const std::string m_status;
650  };
651  //----------------------------------------------------------------------------------------------------
653  {
654  explicit daemon_busy(std::string&& loc, const std::string& request)
655  : wallet_rpc_error(std::move(loc), "daemon is busy", request)
656  {
657  }
658  };
659  //----------------------------------------------------------------------------------------------------
661  {
662  explicit no_connection_to_daemon(std::string&& loc, const std::string& request)
663  : wallet_rpc_error(std::move(loc), "no connection to daemon", request)
664  {
665  }
666  };
667  //----------------------------------------------------------------------------------------------------
669  {
670  explicit is_key_image_spent_error(std::string&& loc, const std::string& request)
671  : wallet_rpc_error(std::move(loc), "error from is_key_image_spent call", request)
672  {
673  }
674  };
675  //----------------------------------------------------------------------------------------------------
677  {
678  explicit get_histogram_error(std::string&& loc, const std::string& request)
679  : wallet_rpc_error(std::move(loc), "failed to get output histogram", request)
680  {
681  }
682  };
683  //----------------------------------------------------------------------------------------------------
685  {
686  explicit wallet_files_doesnt_correspond(std::string&& loc, const std::string& keys_file, const std::string& wallet_file)
687  : wallet_logic_error(std::move(loc), "file " + wallet_file + " does not correspond to " + keys_file)
688  {
689  }
690 
691  const std::string& keys_file() const { return m_keys_file; }
692  const std::string& wallet_file() const { return m_wallet_file; }
693 
694  std::string to_string() const { return wallet_logic_error::to_string(); }
695 
696  private:
697  std::string m_keys_file;
698  std::string m_wallet_file;
699  };
700  //----------------------------------------------------------------------------------------------------
701 
702 #if !defined(_MSC_VER)
703 
704  template<typename TException, typename... TArgs>
705  void throw_wallet_ex(std::string&& loc, const TArgs&... args)
706  {
707  TException e(std::move(loc), args...);
708  LOG_PRINT_L0(e.to_string());
709  throw e;
710  }
711 
712 #else
713  #include <boost/preprocessor/repetition/enum_binary_params.hpp>
714  #include <boost/preprocessor/repetition/enum_params.hpp>
715  #include <boost/preprocessor/repetition/repeat_from_to.hpp>
716 
717  template<typename TException>
718  void throw_wallet_ex(std::string&& loc)
719  {
720  TException e(std::move(loc));
721  LOG_PRINT_L0(e.to_string());
722  throw e;
723  }
724 
725 #define GEN_throw_wallet_ex(z, n, data) \
726  template<typename TException, BOOST_PP_ENUM_PARAMS(n, typename TArg)> \
727  void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \
728  { \
729  TException e(std::move(loc), BOOST_PP_ENUM_PARAMS(n, arg)); \
730  LOG_PRINT_L0(e.to_string()); \
731  throw e; \
732  }
733 
734  BOOST_PP_REPEAT_FROM_TO(1, 6, GEN_throw_wallet_ex, ~)
735 #endif
736  }
737 }
738 
739 #define STRINGIZE_DETAIL(x) #x
740 #define STRINGIZE(x) STRINGIZE_DETAIL(x)
741 
742 #define THROW_WALLET_EXCEPTION_IF(cond, err_type, ...) \
743  if (cond) \
744  { \
745  LOG_ERROR(#cond << ". THROW EXCEPTION: " << #err_type); \
746  tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
747  }
not_enough_money(std::string &&loc, uint64_t availbable, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:362
Definition: wallet_errors.h:618
Definition: wallet_errors.h:201
Definition: wallet_errors.h:446
is_key_image_spent_error(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:670
no_connection_to_daemon(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:662
Definition: wallet_errors.h:660
wallet_rpc_error(std::string &&loc, const std::string &message, const std::string &request)
Definition: wallet_errors.h:630
std::string m_loc
Definition: wallet_errors.h:110
Definition: wallet_errors.h:263
Definition: wallet_errors.h:416
uint64_t m_fee
Definition: wallet_errors.h:413
std::string m_status
Definition: wallet_errors.h:541
const std::string & request() const
Definition: wallet_errors.h:620
Definition: wallet_errors.h:121
wallet_error_base< std::runtime_error > wallet_runtime_error
Definition: wallet_errors.h:150
const std::string & file() const
Definition: wallet_errors.h:220
tx_not_possible(std::string &&loc, uint64_t availbable, uint64_t tx_amount, uint64_t fee)
Definition: wallet_errors.h:388
Definition: wallet_errors.h:323
const cryptonote::account_keys & acc_keys() const
Definition: wallet_errors.h:285
uint64_t m_tx_amount
Definition: wallet_errors.h:412
Definition: wallet_errors.h:199
void throw_wallet_ex(std::string &&loc, const TArgs &... args)
Definition: wallet_errors.h:705
std::string to_string() const
Definition: wallet_errors.h:526
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:283
std::string get_account_address_as_str(bool testnet, account_public_address const &adr)
Definition: cryptonote_basic_impl.cpp:176
wallet_generic_rpc_error(std::string &&loc, const std::string &request, const std::string &status)
Definition: wallet_errors.h:642
tx_parse_error(std::string &&loc, const cryptonote::blobdata &tx_blob)
Definition: wallet_errors.h:325
size_t get_object_blobsize(const t_object &o)
Definition: cryptonote_format_utils.h:139
std::string m_keys_file
Definition: wallet_errors.h:697
Definition: wallet_errors.h:206
uint64_t tx_amount() const
Definition: wallet_errors.h:397
Definition: wallet_errors.h:128
block_parse_error(std::string &&loc, const cryptonote::blobdata &block_data)
Definition: wallet_errors.h:303
std::vector< cryptonote::tx_destination_entry > destinations_t
Definition: wallet_errors.h:449
std::vector< cryptonote::tx_destination_entry > m_destinations
Definition: wallet_errors.h:577
transfer_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:352
uint64_t fee() const
Definition: wallet_errors.h:561
std::string to_string() const
Definition: wallet_errors.h:372
std::string to_string() const
Definition: wallet_errors.h:470
Definition: block_queue.cpp:41
std::string to_string() const
Definition: wallet_errors.h:594
bool m_testnet
Definition: wallet_errors.h:509
tx_too_big(std::string &&loc, const cryptonote::transaction &tx, uint64_t tx_size_limit)
Definition: wallet_errors.h:584
uint64_t tx_size_limit() const
Definition: wallet_errors.h:592
Definition: wallet_errors.h:160
Definition: wallet_errors.h:582
cryptonote::transaction m_tx
Definition: wallet_errors.h:540
std::unordered_map< uint64_t, uint64_t > scanty_outs_t
Definition: wallet_errors.h:418
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:274
uint64_t amount
Definition: cryptonote_tx_utils.h:52
Definition: wallet_errors.h:640
uint64_t m_available
Definition: wallet_errors.h:382
std::string m_file
Definition: wallet_errors.h:225
uint64_t fee() const
Definition: wallet_errors.h:398
const destinations_t & destinations() const
Definition: wallet_errors.h:467
const cryptonote::blobdata & block_blob() const
Definition: wallet_errors.h:309
bool m_testnet
Definition: wallet_errors.h:579
const char *const failed_rpc_request_messages[]
Definition: wallet_errors.h:113
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:225
cryptonote::transaction m_tx
Definition: wallet_errors.h:179
std::string to_string() const
Definition: wallet_errors.h:240
uint64_t m_available
Definition: wallet_errors.h:411
Definition: wallet_errors.h:676
size_t m_mixin_count
Definition: wallet_errors.h:443
invalid_pregenerated_random(std::string &&loc)
Definition: wallet_errors.h:255
Definition: wallet_errors.h:386
const std::string & keys_file() const
Definition: wallet_errors.h:691
std::string to_string() const
Definition: wallet_errors.h:95
file_error_base< file_save_error_message_index > file_save_error
Definition: wallet_errors.h:231
file_error_base< file_not_found_message_index > file_not_found
Definition: wallet_errors.h:229
Definition: wallet_errors.h:684
Definition: wallet_errors.h:152
Various Tools.
Definition: base58.cpp:43
invalid_priority(std::string &&loc)
Definition: wallet_errors.h:244
Definition: wallet_errors.h:233
failed_rpc_request< refresh_error, get_hashes_error_message_index > get_hashes_error
Definition: wallet_errors.h:319
cryptonote::blobdata m_tx_blob
Definition: wallet_errors.h:336
Definition: wallet_errors.h:668
const crypto::public_key & tx_pub_key() const
Definition: wallet_errors.h:284
Definition: cryptonote_tx_utils.h:43
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:591
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:168
refresh_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:266
Definition: wallet_errors.h:253
std::string obj_to_json_str(T &obj)
Definition: cryptonote_format_utils.h:155
file_error_base< file_read_error_message_index > file_read_error
Definition: wallet_errors.h:230
std::string to_string() const
Definition: wallet_errors.h:138
daemon_busy(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:654
std::string to_string() const
Definition: wallet_errors.h:311
tx_not_constructed(std::string &&loc, sources_t const &sources, destinations_t const &destinations, uint64_t unlock_time, bool testnet)
Definition: wallet_errors.h:451
std::string m_wallet_file
Definition: wallet_errors.h:698
uint64_t amount
Definition: cryptonote_tx_utils.h:75
const scanty_outs_t & scanty_outs() const
Definition: wallet_errors.h:427
not_enough_outs_to_mix(std::string &&loc, const scanty_outs_t &scanty_outs, size_t mixin_count)
Definition: wallet_errors.h:420
sources_t m_sources
Definition: wallet_errors.h:506
const std::string & status() const
Definition: wallet_errors.h:136
get_tx_pool_error(std::string &&loc)
Definition: wallet_errors.h:341
Definition: wallet_errors.h:349
const cryptonote::account_keys m_acc_keys
Definition: wallet_errors.h:298
uint64_t available() const
Definition: wallet_errors.h:396
Definition: account.h:41
get_histogram_error(std::string &&loc, const std::string &request)
Definition: wallet_errors.h:678
std::string to_string() const
Definition: wallet_errors.h:287
zero_destination(std::string &&loc)
Definition: wallet_errors.h:612
std::string to_string() const
Definition: wallet_errors.h:346
POD_CLASS public_key
Definition: crypto.h:65
std::string m_reason
Definition: wallet_errors.h:542
wallet_error_base< std::logic_error > wallet_logic_error
Definition: wallet_errors.h:149
size_t mixin_count() const
Definition: wallet_errors.h:428
tx_rejected(std::string &&loc, const cryptonote::transaction &tx, const std::string &status, const std::string &reason)
Definition: wallet_errors.h:514
std::string m_request
Definition: wallet_errors.h:637
wallet_error_base(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:103
Definition: wallet_errors.h:200
std::string to_string() const
Definition: wallet_errors.h:260
Definition: wallet_errors.h:91
const std::string & reason() const
Definition: wallet_errors.h:524
account_public_address addr
Definition: cryptonote_tx_utils.h:76
std::string blobdata
Definition: blobdatatype.h:36
std::string to_string() const
Definition: wallet_errors.h:430
uint64_t tx_amount() const
Definition: wallet_errors.h:370
const std::string & location() const
Definition: wallet_errors.h:93
uint64_t m_tx_size_limit
Definition: wallet_errors.h:607
Definition: wallet_errors.h:182
const crypto::public_key m_tx_pub_key
Definition: wallet_errors.h:297
Definition: wallet_errors.h:610
Definition: wallet_errors.h:652
std::string to_string() const
Definition: wallet_errors.h:333
Definition: wallet_errors.h:360
const cryptonote::blobdata & tx_blob() const
Definition: wallet_errors.h:331
failed_rpc_request(std::string &&loc, const std::string &status)
Definition: wallet_errors.h:130
const std::string & status() const
Definition: wallet_errors.h:523
const std::string & wallet_file() const
Definition: wallet_errors.h:692
wallet_internal_error(std::string &&loc, const std::string &message)
Definition: wallet_errors.h:154
wallet_files_doesnt_correspond(std::string &&loc, const std::string &keys_file, const std::string &wallet_file)
Definition: wallet_errors.h:686
std::string to_string() const
Definition: wallet_errors.h:694
Definition: wallet_errors.h:242
cryptonote::blobdata m_block_blob
Definition: wallet_errors.h:314
std::string to_string() const
Definition: wallet_errors.h:400
const std::vector< cryptonote::tx_destination_entry > & destinations() const
Definition: wallet_errors.h:560
std::string to_string() const
Definition: wallet_errors.h:563
std::string m_status
Definition: wallet_errors.h:146
Definition: cryptonote_tx_utils.h:73
uint64_t m_tx_amount
Definition: wallet_errors.h:383
uint64_t m_fee
Definition: wallet_errors.h:578
std::string to_string() const
Definition: wallet_errors.h:622
failed_rpc_request< refresh_error, get_blocks_error_message_index > get_blocks_error
Definition: wallet_errors.h:317
std::string to_string() const
Definition: wallet_errors.h:170
const cryptonote::transaction & tx() const
Definition: wallet_errors.h:522
std::vector< cryptonote::tx_source_entry > sources_t
Definition: wallet_errors.h:448
Definition: wallet_errors.h:512
scanty_outs_t m_scanty_outs
Definition: wallet_errors.h:442
Definition: wallet_errors.h:122
failed_rpc_request< refresh_error, get_out_indices_error_message_index > get_out_indices_error
Definition: wallet_errors.h:321
failed_rpc_request_message_indices
Definition: wallet_errors.h:119
cryptonote::transaction m_tx
Definition: wallet_errors.h:606
std::string to_string(t_connection_type type)
Definition: connection_basic.cpp:96
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:554
uint64_t m_unlock_time
Definition: wallet_errors.h:508
const cryptonote::transaction m_tx
Definition: wallet_errors.h:296
const std::string & status() const
Definition: wallet_errors.h:647
file_error_base(std::string &&loc, const std::string &file)
Definition: wallet_errors.h:208
file_error_message_indices
Definition: wallet_errors.h:197
unexpected_txin_type(std::string &&loc, const cryptonote::transaction &tx)
Definition: wallet_errors.h:162
Definition: wallet_errors.h:272
wallet_not_initialized(std::string &&loc)
Definition: wallet_errors.h:184
uint64_t available() const
Definition: wallet_errors.h:369
failed_rpc_request< transfer_error, get_random_outs_error_message_index > get_random_outs_error
Definition: wallet_errors.h:358
destinations_t m_destinations
Definition: wallet_errors.h:507
uint64_t unlock_time() const
Definition: wallet_errors.h:468
std::string to_string() const
Definition: wallet_errors.h:249
invalid_password(std::string &&loc)
Definition: wallet_errors.h:235
file_error_base< file_exists_message_index > file_exists
Definition: wallet_errors.h:228
Definition: cryptonote_basic.h:198
std::string to_string() const
Definition: wallet_errors.h:222
Definition: wallet_errors.h:545
Definition: wallet_errors.h:202
Definition: wallet_errors.h:339
tx_sum_overflow(std::string &&loc, const std::vector< cryptonote::tx_destination_entry > &destinations, uint64_t fee, bool testnet)
Definition: wallet_errors.h:547
Definition: wallet_errors.h:301
const std::string m_status
Definition: wallet_errors.h:649
const char *const file_error_messages[]
Definition: wallet_errors.h:191
const sources_t & sources() const
Definition: wallet_errors.h:466