Skip to content

Commit 16291a4

Browse files
committed
Remove old set channel signer availability method
1 parent 09536ba commit 16291a4

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -482,47 +482,6 @@ impl<'a, 'b, 'c> Node<'a, 'b, 'c> {
482482
pub fn get_block_header(&self, height: u32) -> Header {
483483
self.blocks.lock().unwrap()[height as usize].0.header
484484
}
485-
/// Changes the channel signer's availability for the specified peer and channel.
486-
///
487-
/// When `available` is set to `true`, the channel signer will behave normally. When set to
488-
/// `false`, the channel signer will act like an off-line remote signer and will return `Err` for
489-
/// several of the signing methods. Currently, only `get_per_commitment_point` and
490-
/// `release_commitment_secret` are affected by this setting.
491-
#[cfg(test)]
492-
pub fn set_channel_signer_available(&self, peer_id: &PublicKey, chan_id: &ChannelId, available: bool) {
493-
use crate::sign::ChannelSigner;
494-
log_debug!(self.logger, "Setting channel signer for {} as available={}", chan_id, available);
495-
496-
let per_peer_state = self.node.per_peer_state.read().unwrap();
497-
let chan_lock = per_peer_state.get(peer_id).unwrap().lock().unwrap();
498-
499-
let mut channel_keys_id = None;
500-
if let Some(chan) = chan_lock.channel_by_id.get(chan_id).map(|phase| phase.context()) {
501-
chan.get_signer().as_ecdsa().unwrap().set_available(available);
502-
channel_keys_id = Some(chan.channel_keys_id);
503-
}
504-
505-
let mut monitor = None;
506-
for (funding_txo, channel_id) in self.chain_monitor.chain_monitor.list_monitors() {
507-
if *chan_id == channel_id {
508-
monitor = self.chain_monitor.chain_monitor.get_monitor(funding_txo).ok();
509-
}
510-
}
511-
if let Some(monitor) = monitor {
512-
monitor.do_signer_call(|signer| {
513-
channel_keys_id = channel_keys_id.or(Some(signer.inner.channel_keys_id()));
514-
signer.set_available(available)
515-
});
516-
}
517-
518-
if available {
519-
self.keys_manager.unavailable_signers.lock().unwrap()
520-
.remove(channel_keys_id.as_ref().unwrap());
521-
} else {
522-
self.keys_manager.unavailable_signers.lock().unwrap()
523-
.insert(channel_keys_id.unwrap());
524-
}
525-
}
526485

527486
/// Changes the channel signer's availability for the specified peer and channel.
528487
///

0 commit comments

Comments
 (0)