@@ -55,7 +55,7 @@ pub trait ChainWatchInterface: Sync + Send {
55
55
56
56
/// Gets the list of transaction indices within a given block that the ChainWatchInterface is
57
57
/// watching for.
58
- fn filter_block ( & self , block : & Block ) -> Vec < u32 > ;
58
+ fn filter_block ( & self , block : & Block ) -> Vec < usize > ;
59
59
60
60
/// Returns a usize that changes when the ChainWatchInterface's watched data is modified.
61
61
/// Users of `filter_block` should pre-save a copy of `reentered`'s return value and use it to
@@ -86,7 +86,7 @@ pub trait ChainListener: Sync + Send {
86
86
///
87
87
/// This also means those counting confirmations using block_connected callbacks should watch
88
88
/// for duplicate headers and not count them towards confirmations!
89
- fn block_connected ( & self , header : & BlockHeader , height : u32 , txn_matched : & [ & Transaction ] , indexes_of_txn_matched : & [ u32 ] ) ;
89
+ fn block_connected ( & self , header : & BlockHeader , height : u32 , txn_matched : & [ & Transaction ] , indexes_of_txn_matched : & [ usize ] ) ;
90
90
/// Notifies a listener that a block was disconnected.
91
91
/// Unlike block_connected, this *must* never be called twice for the same disconnect event.
92
92
/// Height must be the one of the block which was disconnected (not new height of the best chain)
@@ -280,7 +280,7 @@ impl<'a, CL: Deref<Target = ChainListener + 'a> + 'a, C: Deref> BlockNotifier<'a
280
280
let matched_indexes = self . chain_monitor . filter_block ( block) ;
281
281
let mut matched_txn = Vec :: new ( ) ;
282
282
for index in matched_indexes. iter ( ) {
283
- matched_txn. push ( & block. txdata [ * index as usize ] ) ;
283
+ matched_txn. push ( & block. txdata [ * index] ) ;
284
284
}
285
285
reentered = self . block_connected_checked ( & block. header , height, matched_txn. as_slice ( ) , matched_indexes. as_slice ( ) ) ;
286
286
}
@@ -292,7 +292,7 @@ impl<'a, CL: Deref<Target = ChainListener + 'a> + 'a, C: Deref> BlockNotifier<'a
292
292
/// Returns true if notified listeners registered additional watch data (implying that the
293
293
/// block must be re-scanned and this function called again prior to further block_connected
294
294
/// calls, see ChainListener::block_connected for more info).
295
- pub fn block_connected_checked ( & self , header : & BlockHeader , height : u32 , txn_matched : & [ & Transaction ] , indexes_of_txn_matched : & [ u32 ] ) -> bool {
295
+ pub fn block_connected_checked ( & self , header : & BlockHeader , height : u32 , txn_matched : & [ & Transaction ] , indexes_of_txn_matched : & [ usize ] ) -> bool {
296
296
let last_seen = self . chain_monitor . reentered ( ) ;
297
297
298
298
let listeners = self . listeners . lock ( ) . unwrap ( ) ;
@@ -361,13 +361,13 @@ impl ChainWatchInterface for ChainWatchInterfaceUtil {
361
361
Err ( ChainError :: NotSupported )
362
362
}
363
363
364
- fn filter_block ( & self , block : & Block ) -> Vec < u32 > {
364
+ fn filter_block ( & self , block : & Block ) -> Vec < usize > {
365
365
let mut matched_index = Vec :: new ( ) ;
366
366
{
367
367
let watched = self . watched . lock ( ) . unwrap ( ) ;
368
368
for ( index, transaction) in block. txdata . iter ( ) . enumerate ( ) {
369
369
if self . does_match_tx_unguarded ( transaction, & watched) {
370
- matched_index. push ( index as u32 ) ;
370
+ matched_index. push ( index) ;
371
371
}
372
372
}
373
373
}
0 commit comments