Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,29 +1465,30 @@ where
self.runtime.spawn_cancellable_background_task(future);
},
LdkEvent::BumpTransaction(bte) => {
match bte {
let (channel_id, counterparty_node_id) = match bte {
BumpTransactionEvent::ChannelClose {
ref channel_id,
ref counterparty_node_id,
..
} => {
// Skip bumping channel closes if our counterparty is trusted.
if let Some(anchor_channels_config) =
self.config.anchor_channels_config.as_ref()
{
if anchor_channels_config
.trusted_peers_no_reserve
.contains(counterparty_node_id)
{
log_debug!(self.logger,
"Ignoring BumpTransactionEvent::ChannelClose for channel {} due to trusted counterparty {}",
channel_id, counterparty_node_id
);
return Ok(());
}
}
},
BumpTransactionEvent::HTLCResolution { .. } => {},
} => (channel_id, counterparty_node_id),
BumpTransactionEvent::HTLCResolution {
ref channel_id,
ref counterparty_node_id,
..
} => (channel_id, counterparty_node_id),
};

if let Some(anchor_channels_config) = self.config.anchor_channels_config.as_ref() {
if anchor_channels_config
.trusted_peers_no_reserve
.contains(counterparty_node_id)
{
log_debug!(self.logger,
"Ignoring BumpTransactionEvent for channel {} due to trusted counterparty {}",
channel_id, counterparty_node_id
);
return Ok(());
}
}

self.bump_tx_event_handler.handle_event(&bte).await;
Expand Down