Skip to content

Commit 4db1ffd

Browse files
committed
f Add assertion that we can't downgrade to anchor_zero_fee_commitments
1 parent 6fe04ad commit 4db1ffd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4886,6 +4886,11 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
48864886

48874887
let next_channel_type = get_initial_channel_type(user_config, &eligible_features);
48884888

4889+
// Note that we can't get `anchor_zero_fee_commitments` type here, which requires zero
4890+
// fees, because we downgrade from this channel type first. If there were a superior
4891+
// channel type that downgrades to `anchor_zero_fee_commitments`, we'd need to handle
4892+
// fee setting differently here.
4893+
assert!(!next_channel_type.supports_anchor_zero_fee_commitments());
48894894
let conf_target = if next_channel_type.supports_anchors_zero_fee_htlc_tx() {
48904895
ConfirmationTarget::AnchorChannelFee
48914896
} else {

0 commit comments

Comments
 (0)