@@ -13,10 +13,10 @@ pub struct CanonicalIter<'g, A, C> {
13
13
chain : & ' g C ,
14
14
chain_tip : BlockId ,
15
15
16
- unprocessed_txs_with_anchors :
16
+ unprocessed_anchored_txs :
17
17
Box < dyn Iterator < Item = ( Txid , Arc < Transaction > , & ' g BTreeSet < A > ) > + ' g > ,
18
- unprocessed_txs_with_last_seens : Box < dyn Iterator < Item = ( Txid , Arc < Transaction > , u64 ) > + ' g > ,
19
- unprocessed_txs_left_over : VecDeque < ( Txid , Arc < Transaction > , u32 ) > ,
18
+ unprocessed_seen_txs : Box < dyn Iterator < Item = ( Txid , Arc < Transaction > , u64 ) > + ' g > ,
19
+ unprocessed_leftover_txs : VecDeque < ( Txid , Arc < Transaction > , u32 ) > ,
20
20
21
21
canonical : HashMap < Txid , ( Arc < Transaction > , CanonicalReason < A > ) > ,
22
22
not_canonical : HashSet < Txid > ,
@@ -28,12 +28,12 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
28
28
/// Constructs [`CanonicalIter`].
29
29
pub fn new ( tx_graph : & ' g TxGraph < A > , chain : & ' g C , chain_tip : BlockId ) -> Self {
30
30
let anchors = tx_graph. all_anchors ( ) ;
31
- let pending_anchored = Box :: new (
31
+ let unprocessed_anchored_txs = Box :: new (
32
32
tx_graph
33
33
. txids_by_descending_anchor_height ( )
34
34
. filter_map ( |( _, txid) | Some ( ( txid, tx_graph. get_tx ( txid) ?, anchors. get ( & txid) ?) ) ) ,
35
35
) ;
36
- let pending_last_seen = Box :: new (
36
+ let unprocessed_seen_txs = Box :: new (
37
37
tx_graph
38
38
. txids_by_descending_last_seen ( )
39
39
. filter_map ( |( last_seen, txid) | Some ( ( txid, tx_graph. get_tx ( txid) ?, last_seen) ) ) ,
@@ -42,9 +42,9 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
42
42
tx_graph,
43
43
chain,
44
44
chain_tip,
45
- unprocessed_txs_with_anchors : pending_anchored ,
46
- unprocessed_txs_with_last_seens : pending_last_seen ,
47
- unprocessed_txs_left_over : VecDeque :: new ( ) ,
45
+ unprocessed_anchored_txs ,
46
+ unprocessed_seen_txs ,
47
+ unprocessed_leftover_txs : VecDeque :: new ( ) ,
48
48
canonical : HashMap :: new ( ) ,
49
49
not_canonical : HashSet :: new ( ) ,
50
50
queue : VecDeque :: new ( ) ,
@@ -73,7 +73,7 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
73
73
}
74
74
}
75
75
// cannot determine
76
- self . unprocessed_txs_left_over . push_back ( (
76
+ self . unprocessed_leftover_txs . push_back ( (
77
77
txid,
78
78
tx,
79
79
anchors
@@ -147,7 +147,7 @@ impl<A: Anchor, C: ChainOracle> Iterator for CanonicalIter<'_, A, C> {
147
147
return Some ( Ok ( ( txid, tx, reason) ) ) ;
148
148
}
149
149
150
- if let Some ( ( txid, tx, anchors) ) = self . unprocessed_txs_with_anchors . next ( ) {
150
+ if let Some ( ( txid, tx, anchors) ) = self . unprocessed_anchored_txs . next ( ) {
151
151
if !self . is_canonicalized ( txid) {
152
152
if let Err ( err) = self . scan_anchors ( txid, tx, anchors) {
153
153
return Some ( Err ( err) ) ;
@@ -156,15 +156,15 @@ impl<A: Anchor, C: ChainOracle> Iterator for CanonicalIter<'_, A, C> {
156
156
continue ;
157
157
}
158
158
159
- if let Some ( ( txid, tx, last_seen) ) = self . unprocessed_txs_with_last_seens . next ( ) {
159
+ if let Some ( ( txid, tx, last_seen) ) = self . unprocessed_seen_txs . next ( ) {
160
160
if !self . is_canonicalized ( txid) {
161
161
let observed_in = ObservedIn :: Mempool ( last_seen) ;
162
162
self . mark_canonical ( txid, tx, CanonicalReason :: from_observed_in ( observed_in) ) ;
163
163
}
164
164
continue ;
165
165
}
166
166
167
- if let Some ( ( txid, tx, height) ) = self . unprocessed_txs_left_over . pop_front ( ) {
167
+ if let Some ( ( txid, tx, height) ) = self . unprocessed_leftover_txs . pop_front ( ) {
168
168
if !self . is_canonicalized ( txid) {
169
169
let observed_in = ObservedIn :: Block ( height) ;
170
170
self . mark_canonical ( txid, tx, CanonicalReason :: from_observed_in ( observed_in) ) ;
0 commit comments