@@ -45,11 +45,6 @@ pub trait ChainWatchInterface: Sync + Send {
45
45
/// Indicates that a listener needs to see all transactions.
46
46
fn watch_all_txn ( & self ) ;
47
47
48
- /// Register the given listener to receive events. Only a weak pointer is provided and the
49
- /// registration should be freed once that pointer expires.
50
- fn register_listener ( & self , listener : Weak < ChainListener > ) ;
51
- //TODO: unregister
52
-
53
48
/// Gets the script and value in satoshis for a given unspent transaction output given a
54
49
/// short_channel_id (aka unspent_tx_output_identier). For BTC/tBTC channels the top three
55
50
/// bytes are the block height, the next 3 the transaction index within the block, and the
@@ -282,7 +277,6 @@ impl BlockNotifier {
282
277
pub struct ChainWatchInterfaceUtil {
283
278
network : Network ,
284
279
watched : Mutex < ChainWatchedUtil > ,
285
- listeners : Mutex < Vec < Weak < ChainListener > > > ,
286
280
reentered : AtomicUsize ,
287
281
logger : Arc < Logger > ,
288
282
}
@@ -310,11 +304,6 @@ impl ChainWatchInterface for ChainWatchInterfaceUtil {
310
304
}
311
305
}
312
306
313
- fn register_listener ( & self , listener : Weak < ChainListener > ) {
314
- let mut vec = self . listeners . lock ( ) . unwrap ( ) ;
315
- vec. push ( listener) ;
316
- }
317
-
318
307
fn get_chain_utxo ( & self , genesis_hash : Sha256dHash , _unspent_tx_output_identifier : u64 ) -> Result < ( Script , u64 ) , ChainError > {
319
308
if genesis_hash != genesis_block ( self . network ) . header . bitcoin_hash ( ) {
320
309
return Err ( ChainError :: NotWatched ) ;
@@ -348,7 +337,6 @@ impl ChainWatchInterfaceUtil {
348
337
ChainWatchInterfaceUtil {
349
338
network : network,
350
339
watched : Mutex :: new ( ChainWatchedUtil :: new ( ) ) ,
351
- listeners : Mutex :: new ( Vec :: new ( ) ) ,
352
340
reentered : AtomicUsize :: new ( 1 ) ,
353
341
logger : logger,
354
342
}
0 commit comments