Skip to content

Commit e9001aa

Browse files
committed
Refer to channels busy with funding tx negotiation as "unfunded"
We had some inconsistencies so far in referring to channels such as `OutboundV1Channel` and `InboundV1Channel` as pending and unfunded. From here we refer to these kinds of channels only as "unfunded". This is a slight conflation with the term "unfunded" in the contexts of denial of service mitigation. There, "unfunded" actually refers to non-0conf, inbound channels that have not had their funding transaction confirmed. This might warrant changing that usage to "unconfirmed inbound".
1 parent 2e86a59 commit e9001aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ impl <Signer: ChannelSigner> PeerState<Signer> {
685685
&& self.in_flight_monitor_updates.is_empty()
686686
}
687687

688-
// Returns a count of all channels we have with this peer, including pending channels.
688+
// Returns a count of all channels we have with this peer, including unfunded channels.
689689
fn total_channel_count(&self) -> usize {
690690
self.channel_by_id.len() +
691691
self.outbound_v1_channel_by_id.len() +
@@ -1749,12 +1749,12 @@ macro_rules! convert_chan_err {
17491749
},
17501750
}
17511751
};
1752-
($self: ident, $err: expr, $channel_context: expr, $channel_id: expr, PREFUNDED) => {
1752+
($self: ident, $err: expr, $channel_context: expr, $channel_id: expr, UNFUNDED) => {
17531753
match $err {
1754-
// We should only ever have `ChannelError::Close` when prefunded channels error.
1754+
// We should only ever have `ChannelError::Close` when unfunded channels error.
17551755
// In any case, just close the channel.
17561756
ChannelError::Warn(msg) | ChannelError::Ignore(msg) | ChannelError::Close(msg) => {
1757-
log_error!($self.logger, "Closing prefunded channel {} due to an error: {}", log_bytes!($channel_id[..]), msg);
1757+
log_error!($self.logger, "Closing unfunded channel {} due to an error: {}", log_bytes!($channel_id[..]), msg);
17581758
update_maps_on_chan_removal!($self, &$channel_context);
17591759
let shutdown_res = $channel_context.force_shutdown(false);
17601760
(true, MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, $channel_context.get_user_id(),
@@ -1784,7 +1784,7 @@ macro_rules! try_v1_outbound_chan_entry {
17841784
match $res {
17851785
Ok(res) => res,
17861786
Err(e) => {
1787-
let (drop, res) = convert_chan_err!($self, e, $entry.get_mut().context, $entry.key(), PREFUNDED);
1787+
let (drop, res) = convert_chan_err!($self, e, $entry.get_mut().context, $entry.key(), UNFUNDED);
17881788
if drop {
17891789
$entry.remove_entry();
17901790
}
@@ -2535,14 +2535,14 @@ where
25352535
self.issue_channel_close_events(&chan.get().context, closure_reason);
25362536
let mut chan = remove_channel!(self, chan);
25372537
self.finish_force_close_channel(chan.context.force_shutdown(false));
2538-
// Prefunded channel has no update
2538+
// Unfunded channel has no update
25392539
(None, chan.context.get_counterparty_node_id())
25402540
} else if let hash_map::Entry::Occupied(chan) = peer_state.inbound_v1_channel_by_id.entry(channel_id.clone()) {
25412541
log_error!(self.logger, "Force-closing channel {}", log_bytes!(channel_id[..]));
25422542
self.issue_channel_close_events(&chan.get().context, closure_reason);
25432543
let mut chan = remove_channel!(self, chan);
25442544
self.finish_force_close_channel(chan.context.force_shutdown(false));
2545-
// Prefunded channel has no update
2545+
// Unfunded channel has no update
25462546
(None, chan.context.get_counterparty_node_id())
25472547
} else {
25482548
return Err(APIError::ChannelUnavailable{ err: format!("Channel with id {} not found for the passed counterparty node_id {}", log_bytes!(*channel_id), peer_node_id) });

0 commit comments

Comments
 (0)