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"));
}
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;