forked from ethereum/btcrelay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.se
63 lines (56 loc) · 1.66 KB
/
constants.se
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Constants
# for verifying Bitcoin difficulty
macro DIFFICULTY_ADJUSTMENT_INTERVAL: 2016 # Bitcoin adjusts every 2 weeks
macro TARGET_TIMESPAN: 14 * 24 * 60 * 60 # 2 weeks
macro TARGET_TIMESPAN_DIV_4: TARGET_TIMESPAN / 4
macro TARGET_TIMESPAN_MUL_4: TARGET_TIMESPAN * 4
macro UNROUNDED_MAX_TARGET: 2**224 - 1 # different from (2**16-1)*2**208 http://bitcoin.stackexchange.com/questions/13803/how-exactly-was-the-original-coefficient-for-difficulty-determined
#
# Error / failure codes
#
# error codes for storeBlockHeader
macro ERR_DIFFICULTY: 10010 # difficulty didn't match current difficulty
macro ERR_RETARGET: 10020 # difficulty didn't match retarget
macro ERR_NO_PREV_BLOCK: 10030
macro ERR_BLOCK_ALREADY_EXISTS: 10040
macro ERR_PROOF_OF_WORK: 10090
# error codes for verifyTx
macro ERR_BAD_FEE: 20010
macro ERR_CONFIRMATIONS: 20020
macro ERR_CHAIN: 20030
macro ERR_MERKLE_ROOT: 20040
macro ERR_TX_64BYTE: 20050
# error codes for relayTx
macro ERR_RELAY_VERIFY: 30010
macro BYTES_1: 2**8
macro BYTES_2: 2**16
macro BYTES_3: 2**24
macro BYTES_4: 2**32
macro BYTES_5: 2**40
macro BYTES_6: 2**48
macro BYTES_7: 2**56
macro BYTES_8: 2**64
macro BYTES_9: 2**72
macro BYTES_10: 2**80
macro BYTES_11: 2**88
macro BYTES_12: 2**96
macro BYTES_13: 2**104
macro BYTES_14: 2**112
macro BYTES_15: 2**120
macro BYTES_16: 2**128
macro BYTES_17: 2**136
macro BYTES_18: 2**144
macro BYTES_19: 2**152
macro BYTES_20: 2**160
macro BYTES_21: 2**168
macro BYTES_22: 2**176
macro BYTES_23: 2**184
macro BYTES_24: 2**192
macro BYTES_25: 2**200
macro BYTES_26: 2**208
macro BYTES_27: 2**216
macro BYTES_28: 2**224
macro BYTES_29: 2**232
macro BYTES_30: 2**240
macro BYTES_31: 2**248
macro BYTES_32: 2**256