electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

libbitcoin_errors.py (1443B)


      1 import enum
      2 
      3 
      4 def make_error_code(ec):
      5     if not ec:
      6         return None
      7     return ErrorCode(ec)
      8 
      9 
     10 class ErrorCode(enum.Enum):
     11 
     12     nothing = 0
     13 
     14     service_stopped = 1
     15     operation_failed = 2
     16 
     17     # blockchain errors
     18     not_found = 3
     19     duplicate = 4
     20     unspent_output = 5
     21     unsupported_payment_type = 6
     22 
     23     # network errors
     24     resolve_failed = 7
     25     network_unreachable = 8
     26     address_in_use = 9
     27     listen_failed = 10
     28     accept_failed = 11
     29     bad_stream = 12
     30     channel_timeout = 13
     31 
     32     # transaction pool
     33     blockchain_reorganized = 14
     34     pool_filled = 15
     35 
     36     # validate tx
     37     coinbase_transaction = 16
     38     is_not_standard = 17
     39     double_spend = 18
     40     input_not_found = 19
     41 
     42     # check_transaction()
     43     empty_transaction = 20
     44     output_value_overflow = 21
     45     invalid_coinbase_script_size = 22
     46     previous_output_null = 23
     47 
     48     # validate block
     49     previous_block_invalid = 24
     50 
     51     # check_block()
     52     size_limits = 25
     53     proof_of_work = 26
     54     futuristic_timestamp = 27
     55     first_not_coinbase = 28
     56     extra_coinbases = 29
     57     too_many_sigs = 30
     58     merkle_mismatch = 31
     59 
     60     # accept_block()
     61     incorrect_proof_of_work = 32
     62     timestamp_too_early = 33
     63     non_final_transaction = 34
     64     checkpoints_failed = 35
     65     old_version_block = 36
     66     coinbase_height_mismatch = 37
     67 
     68     # connect_block()
     69     duplicate_or_spent = 38
     70     validate_inputs_failed = 39
     71     fees_out_of_range = 40
     72     coinbase_too_large = 41