@@ -72,11 +72,16 @@ pub trait BroadcasterInterface: Sync + Send {
72
72
/// A trait indicating a desire to listen for events from the chain
73
73
pub trait ChainListener : Sync + Send {
74
74
/// Notifies a listener that a block was connected.
75
- /// Note that if a new transaction/outpoint is watched during a block_connected call, the block
76
- /// *must* be re-scanned with the new transaction/outpoints and block_connected should be
77
- /// called again with the same header and (at least) the new transactions.
78
75
///
79
- /// Note that if non-new transaction/outpoints may be registered during a call, a second call
76
+ /// The txn_matched array should be set to references to transactions which matched the
77
+ /// relevant installed watch outpoints/txn, or the full set of transactions in the block.
78
+ ///
79
+ /// Note that if txn_matched includes only matched transactions, and a new
80
+ /// transaction/outpoint is watched during a block_connected call, the block *must* be
81
+ /// re-scanned with the new transaction/outpoints and block_connected should be called
82
+ /// again with the same header and (at least) the new transactions.
83
+ ///
84
+ /// Note that if non-new transaction/outpoints are be registered during a call, a second call
80
85
/// *must not* happen.
81
86
///
82
87
/// This also means those counting confirmations using block_connected callbacks should watch
@@ -281,15 +286,13 @@ impl<'a, CL: Deref<Target = ChainListener + 'a> + 'a> BlockNotifier<'a, CL> {
281
286
return last_seen != self . chain_monitor . reentered ( ) ;
282
287
}
283
288
284
-
285
289
/// Notify listeners that a block was disconnected.
286
290
pub fn block_disconnected ( & self , header : & BlockHeader , disconnected_height : u32 ) {
287
291
let listeners = self . listeners . lock ( ) . unwrap ( ) ;
288
292
for listener in listeners. iter ( ) {
289
293
listener. block_disconnected ( & header, disconnected_height) ;
290
294
}
291
295
}
292
-
293
296
}
294
297
295
298
/// Utility to capture some common parts of ChainWatchInterface implementors.
@@ -363,7 +366,6 @@ impl ChainWatchInterfaceUtil {
363
366
}
364
367
}
365
368
366
-
367
369
/// Checks if a given transaction matches the current filter.
368
370
pub fn does_match_tx ( & self , tx : & Transaction ) -> bool {
369
371
let watched = self . watched . lock ( ) . unwrap ( ) ;
0 commit comments