Skip to content

Commit 9769122

Browse files
f Fix Only set outbound_htlc_minimum_msat if TheirInitSent
1 parent cb5835c commit 9769122

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
16801680
features: InitFeatures::empty(),
16811681
unspendable_punishment_reserve: to_remote_reserve_satoshis,
16821682
forwarding_info: channel.counterparty_forwarding_info(),
1683-
outbound_htlc_minimum_msat: Some(channel.get_counterparty_htlc_minimum_msat()),
1683+
// Ensures that we have actually received the `htlc_minimum_msat` value
1684+
// from the counterparty through the `OpenChannel` or `AcceptChannel`
1685+
// message (as they are always the first message from the counterparty).
1686+
// Else `Channel::get_counterparty_htlc_minimum_msat` could return the
1687+
// default `0` value set by `Channel::new_outbound`.
1688+
outbound_htlc_minimum_msat: if channel.have_received_message() {
1689+
Some(channel.get_counterparty_htlc_minimum_msat()) } else { None },
16841690
outbound_htlc_maximum_msat: channel.get_counterparty_htlc_maximum_msat(),
16851691
},
16861692
funding_txo: channel.get_funding_txo(),

0 commit comments

Comments
 (0)