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
crate::ix!();
pub struct NodeTxRelay {
pub cs_filter: Arc<Mutex<NodeTxRelayFilter>>,
pub cs_tx_inventory: Arc<Mutex<NodeTxRelayTxInventory>>,
pub set_inventory_tx_to_send: Arc<Mutex<HashSet<u256>>>,
pub last_mempool_req: Atomic<Option<OffsetDateTime>>, pub n_next_inv_send: Arc<Mutex<Option<OffsetDateTime>>>, pub min_fee_filter: Atomic<Amount>,
pub last_sent_fee_filter: Amount,
pub next_send_feefilter: Option<OffsetDateTime>, }
impl Default for NodeTxRelay {
fn default() -> Self {
Self {
cs_filter: Arc::new(Mutex::new(NodeTxRelayFilter::default())),
cs_tx_inventory: Arc::new(Mutex::new(NodeTxRelayTxInventory::default())),
set_inventory_tx_to_send: Default::default(),
last_mempool_req: Atomic::new(None),
n_next_inv_send: Arc::new(Mutex::new(None)),
min_fee_filter: Atomic::new(0),
last_sent_fee_filter: 0,
next_send_feefilter: None,
}
}
}
pub struct NodeTxRelayFilter {
pub relay_txes: bool,
pub pfilter: Option<BloomFilter>,
}
impl Default for NodeTxRelayFilter {
fn default() -> Self {
Self {
relay_txes: false,
pfilter: None,
}
}
}
pub struct NodeTxRelayTxInventory {
pub filter_inventory_known: RollingBloomFilter,
pub send_mempool: bool,
}
impl Default for NodeTxRelayTxInventory {
fn default() -> Self {
Self {
filter_inventory_known: RollingBloomFilter::new(50000, 0.000001),
send_mempool: false,
}
}
}