@@ -17,10 +17,10 @@ pub struct CanonicalIter<'g, A, C> {
17
17
chain : & ' g C ,
18
18
chain_tip : BlockId ,
19
19
20
- unprocessed_txs_with_anchors :
20
+ unprocessed_anchored_txs :
21
21
Box < dyn Iterator < Item = ( Txid , Arc < Transaction > , & ' g BTreeSet < A > ) > + ' g > ,
22
- unprocessed_txs_with_last_seens : Box < dyn Iterator < Item = ( Txid , Arc < Transaction > , u64 ) > + ' g > ,
23
- unprocessed_txs_left_over : VecDeque < ( Txid , Arc < Transaction > , u32 ) > ,
22
+ unprocessed_seen_txs : Box < dyn Iterator < Item = ( Txid , Arc < Transaction > , u64 ) > + ' g > ,
23
+ unprocessed_leftover_txs : VecDeque < ( Txid , Arc < Transaction > , u32 ) > ,
24
24
25
25
canonical : CanonicalMap < A > ,
26
26
not_canonical : NotCanonicalSet ,
@@ -32,12 +32,12 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
32
32
/// Constructs [`CanonicalIter`].
33
33
pub fn new ( tx_graph : & ' g TxGraph < A > , chain : & ' g C , chain_tip : BlockId ) -> Self {
34
34
let anchors = tx_graph. all_anchors ( ) ;
35
- let pending_anchored = Box :: new (
35
+ let unprocessed_anchored_txs = Box :: new (
36
36
tx_graph
37
37
. txids_by_descending_anchor_height ( )
38
38
. filter_map ( |( _, txid) | Some ( ( txid, tx_graph. get_tx ( txid) ?, anchors. get ( & txid) ?) ) ) ,
39
39
) ;
40
- let pending_last_seen = Box :: new (
40
+ let unprocessed_seen_txs = Box :: new (
41
41
tx_graph
42
42
. txids_by_descending_last_seen ( )
43
43
. filter_map ( |( last_seen, txid) | Some ( ( txid, tx_graph. get_tx ( txid) ?, last_seen) ) ) ,
@@ -46,9 +46,9 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
46
46
tx_graph,
47
47
chain,
48
48
chain_tip,
49
- unprocessed_txs_with_anchors : pending_anchored ,
50
- unprocessed_txs_with_last_seens : pending_last_seen ,
51
- unprocessed_txs_left_over : VecDeque :: new ( ) ,
49
+ unprocessed_anchored_txs ,
50
+ unprocessed_seen_txs ,
51
+ unprocessed_leftover_txs : VecDeque :: new ( ) ,
52
52
canonical : HashMap :: new ( ) ,
53
53
not_canonical : HashSet :: new ( ) ,
54
54
queue : VecDeque :: new ( ) ,
@@ -77,7 +77,7 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
77
77
}
78
78
}
79
79
// cannot determine
80
- self . unprocessed_txs_left_over . push_back ( (
80
+ self . unprocessed_leftover_txs . push_back ( (
81
81
txid,
82
82
tx,
83
83
anchors
@@ -190,7 +190,7 @@ impl<A: Anchor, C: ChainOracle> Iterator for CanonicalIter<'_, A, C> {
190
190
return Some ( Ok ( ( txid, tx, reason) ) ) ;
191
191
}
192
192
193
- if let Some ( ( txid, tx, anchors) ) = self . unprocessed_txs_with_anchors . next ( ) {
193
+ if let Some ( ( txid, tx, anchors) ) = self . unprocessed_anchored_txs . next ( ) {
194
194
if !self . is_canonicalized ( txid) {
195
195
if let Err ( err) = self . scan_anchors ( txid, tx, anchors) {
196
196
return Some ( Err ( err) ) ;
@@ -199,15 +199,15 @@ impl<A: Anchor, C: ChainOracle> Iterator for CanonicalIter<'_, A, C> {
199
199
continue ;
200
200
}
201
201
202
- if let Some ( ( txid, tx, last_seen) ) = self . unprocessed_txs_with_last_seens . next ( ) {
202
+ if let Some ( ( txid, tx, last_seen) ) = self . unprocessed_seen_txs . next ( ) {
203
203
if !self . is_canonicalized ( txid) {
204
204
let observed_in = ObservedIn :: Mempool ( last_seen) ;
205
205
self . mark_canonical ( txid, tx, CanonicalReason :: from_observed_in ( observed_in) ) ;
206
206
}
207
207
continue ;
208
208
}
209
209
210
- if let Some ( ( txid, tx, height) ) = self . unprocessed_txs_left_over . pop_front ( ) {
210
+ if let Some ( ( txid, tx, height) ) = self . unprocessed_leftover_txs . pop_front ( ) {
211
211
if !self . is_canonicalized ( txid) {
212
212
let observed_in = ObservedIn :: Block ( height) ;
213
213
self . mark_canonical ( txid, tx, CanonicalReason :: from_observed_in ( observed_in) ) ;
0 commit comments