X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=f2f1ad766a9a195ff2306379c18cf9c878f6704f;hp=306d4c5954b9cb4a3d89aa7bb373f044e85020d6;hb=a0723643d2a0d69a8037e6bb2e35b4a4c7788ba2;hpb=d5d4337edc111852c83ab1dd68299bc308759673 diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 306d4c59..f2f1ad76 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -652,9 +652,10 @@ impl Channel { return Err(ChannelError::Close("Insufficient funding amount for initial commitment")); } - let to_local_msat = msg.push_msat; let to_remote_msat = funders_amount_msat - background_feerate * COMMITMENT_TX_BASE_WEIGHT; - if to_local_msat <= msg.channel_reserve_satoshis * 1000 && to_remote_msat <= remote_channel_reserve_satoshis * 1000 { + // While its reasonable for us to not meet the channel reserve initially (if they don't + // want to push much to us), our counterparty should always have more than the reserve. + if to_remote_msat <= remote_channel_reserve_satoshis * 1000 { return Err(ChannelError::Close("Insufficient funding amount for initial commitment")); }