X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=f2f1ad766a9a195ff2306379c18cf9c878f6704f;hb=a0723643d2a0d69a8037e6bb2e35b4a4c7788ba2;hp=151564e556dc76bc3da752b4875ce0a3636c76a9;hpb=479da71192044f805dd9ca0c91719c90adb441e1;p=rust-lightning diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 151564e5..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")); } @@ -2493,6 +2494,7 @@ debug_assert!(false, "This should be triggerable, and we should add a test case let commitment_update = if self.monitor_pending_commitment_signed { Some(self.get_last_commitment_update(logger)) } else { None }; +//XXX: Should we free_holding_cell_htlcs() here if we dont need a cs normally? self.monitor_pending_revoke_and_ack = false; self.monitor_pending_commitment_signed = false;