Skip to content

Commit d960017

Browse files
chaininterface: remove unused listeners field and method
1 parent 896cf97 commit d960017

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/chain/chaininterface.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ pub trait ChainWatchInterface: Sync + Send {
4545
/// Indicates that a listener needs to see all transactions.
4646
fn watch_all_txn(&self);
4747

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-
5348
/// Gets the script and value in satoshis for a given unspent transaction output given a
5449
/// short_channel_id (aka unspent_tx_output_identier). For BTC/tBTC channels the top three
5550
/// bytes are the block height, the next 3 the transaction index within the block, and the
@@ -282,7 +277,6 @@ impl BlockNotifier {
282277
pub struct ChainWatchInterfaceUtil {
283278
network: Network,
284279
watched: Mutex<ChainWatchedUtil>,
285-
listeners: Mutex<Vec<Weak<ChainListener>>>,
286280
reentered: AtomicUsize,
287281
logger: Arc<Logger>,
288282
}
@@ -310,11 +304,6 @@ impl ChainWatchInterface for ChainWatchInterfaceUtil {
310304
}
311305
}
312306

313-
fn register_listener(&self, listener: Weak<ChainListener>) {
314-
let mut vec = self.listeners.lock().unwrap();
315-
vec.push(listener);
316-
}
317-
318307
fn get_chain_utxo(&self, genesis_hash: Sha256dHash, _unspent_tx_output_identifier: u64) -> Result<(Script, u64), ChainError> {
319308
if genesis_hash != genesis_block(self.network).header.bitcoin_hash() {
320309
return Err(ChainError::NotWatched);
@@ -348,7 +337,6 @@ impl ChainWatchInterfaceUtil {
348337
ChainWatchInterfaceUtil {
349338
network: network,
350339
watched: Mutex::new(ChainWatchedUtil::new()),
351-
listeners: Mutex::new(Vec::new()),
352340
reentered: AtomicUsize::new(1),
353341
logger: logger,
354342
}

0 commit comments

Comments
 (0)