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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
crate::ix!();
pub const DEFAULT_WHITELISTRELAY: bool = true;
pub const DEFAULT_WHITELISTFORCERELAY: bool = false;
pub const TIMEOUT_INTERVAL: Duration = Duration::seconds(20 * 60);
pub const FEELER_INTERVAL: Duration = Duration::minutes(2);
pub const EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL: Duration = Duration::minutes(5);
pub const MAX_PROTOCOL_MESSAGE_LENGTH: u32 = 4 * 1000 * 1000;
pub const MAX_SUBVERSION_LENGTH: usize = 256;
pub const MAX_OUTBOUND_FULL_RELAY_CONNECTIONS: usize = 8;
pub const MAX_ADDNODE_CONNECTIONS: usize = 8;
pub const MAX_BLOCK_RELAY_ONLY_CONNECTIONS: usize = 2;
pub const MAX_FEELER_CONNECTIONS: usize = 1;
pub const DEFAULT_LISTEN: bool = true;
pub const DEFAULT_MAX_PEER_CONNECTIONS: usize = 125;
pub const DEFAULT_MAX_UPLOAD_TARGET: u64 = 0;
pub const DEFAULT_BLOCKSONLY: bool = false;
pub const DEFAULT_PEER_CONNECT_TIMEOUT: Duration = Duration::seconds(60);
pub const NUM_FDS_MESSAGE_CAPTURE: i32 = 1;
pub const DEFAULT_FORCEDNSSEED: bool = false;
pub const DEFAULT_DNSSEED: bool = true;
pub const DEFAULT_FIXEDSEEDS: bool = true;
pub const DEFAULT_MAXRECEIVEBUFFER: usize = 5 * 1000;
pub const DEFAULT_MAXSENDBUFFER: usize = 1 * 1000;
pub const MAX_BLOCK_RELAY_ONLY_ANCHORS: usize = 2;
const_assert!{
MAX_BLOCK_RELAY_ONLY_ANCHORS <= MAX_BLOCK_RELAY_ONLY_CONNECTIONS as usize
} pub const ANCHORS_DATABASE_FILENAME: &'static str = "anchors.dat";
pub const DUMP_PEERS_INTERVAL: Duration = Duration::minutes(15);
pub const DNSSEEDS_TO_QUERY_AT_ONCE: i32 = 3;
pub const DNSSEEDS_DELAY_FEW_PEERS: Duration = Duration::seconds(11);
pub const DNSSEEDS_DELAY_MANY_PEERS: Duration = Duration::minutes(5);
pub const DNSSEEDS_DELAY_PEER_THRESHOLD: i32 = 1000; pub const MAX_UPLOAD_TIMEFRAME: Duration = Duration::seconds(60 * 60 * 24);
pub const FEELER_SLEEP_WINDOW: usize = 1;
bitflags!{
pub struct BindFlags: u32 {
const BF_NONE = 0;
const BF_EXPLICIT = 1 << 0;
const BF_REPORT_ERROR = 1 << 1;
const BF_DONT_ADVERTISE = 1 << 2;
}
}
pub const SELECT_TIMEOUT_MILLISECONDS: i64 = 50;
pub const NET_MESSAGE_COMMAND_OTHER: &'static str = "*other*";
pub const RANDOMIZER_ID_NETGROUP: u64 = 0x6c0edd8036ef4036; pub const RANDOMIZER_ID_LOCALHOSTNONCE: u64 = 0xd93e69e2bbfa5735; pub const RANDOMIZER_ID_ADDRCACHE: u64 = 0x1cf2e4ddd306dda9; lazy_static!{
pub static ref DISCOVER: bool = true;
pub static ref LISTEN: bool = true;
pub static ref STR_SUBVERSION: String = String::default();
}
lazy_static!{
}