@@ -55,7 +55,7 @@ pub trait ChainWatchInterface: Sync + Send {
5555
5656 /// Gets the list of transaction indices within a given block that the ChainWatchInterface is
5757 /// watching for.
58- fn filter_block ( & self , block : & Block ) -> Vec < u32 > ;
58+ fn filter_block ( & self , block : & Block ) -> Vec < usize > ;
5959
6060 /// Returns a usize that changes when the ChainWatchInterface's watched data is modified.
6161 /// 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 {
8686 ///
8787 /// This also means those counting confirmations using block_connected callbacks should watch
8888 /// 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 ] ) ;
9090 /// Notifies a listener that a block was disconnected.
9191 /// Unlike block_connected, this *must* never be called twice for the same disconnect event.
9292 /// 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
280280 let matched_indexes = self . chain_monitor . filter_block ( block) ;
281281 let mut matched_txn = Vec :: new ( ) ;
282282 for index in matched_indexes. iter ( ) {
283- matched_txn. push ( & block. txdata [ * index as usize ] ) ;
283+ matched_txn. push ( & block. txdata [ * index] ) ;
284284 }
285285 reentered = self . block_connected_checked ( & block. header , height, matched_txn. as_slice ( ) , matched_indexes. as_slice ( ) ) ;
286286 }
@@ -292,7 +292,7 @@ impl<'a, CL: Deref<Target = ChainListener + 'a> + 'a, C: Deref> BlockNotifier<'a
292292 /// Returns true if notified listeners registered additional watch data (implying that the
293293 /// block must be re-scanned and this function called again prior to further block_connected
294294 /// 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 {
296296 let last_seen = self . chain_monitor . reentered ( ) ;
297297
298298 let listeners = self . listeners . lock ( ) . unwrap ( ) ;
@@ -361,13 +361,13 @@ impl ChainWatchInterface for ChainWatchInterfaceUtil {
361361 Err ( ChainError :: NotSupported )
362362 }
363363
364- fn filter_block ( & self , block : & Block ) -> Vec < u32 > {
364+ fn filter_block ( & self , block : & Block ) -> Vec < usize > {
365365 let mut matched_index = Vec :: new ( ) ;
366366 {
367367 let watched = self . watched . lock ( ) . unwrap ( ) ;
368368 for ( index, transaction) in block. txdata . iter ( ) . enumerate ( ) {
369369 if self . does_match_tx_unguarded ( transaction, & watched) {
370- matched_index. push ( index as u32 ) ;
370+ matched_index. push ( index) ;
371371 }
372372 }
373373 }
0 commit comments