Revert "funding+lnwallet: ensure max_htlc_value_in_flight smaller than capacity"

This reverts commit 4aa52d267f.

It turns out that the other implementations set values for this field
which aren't based on the actual capacity of the channel. As a result,
we'll no reject most of their channel offerings, since they may offer a
value of a max `uint64` or something else hard coded that's above the
size of the channel. As a result, we're reverting this check for now to
maintain proper compatibility.
This commit is contained in:
Olaoluwa Osuntokun committed 2019-01-29 17:58:04 -08:00
1 parent fd1bbe63cf
commit b220c47ce7
4 files changed
+8 -38

No files matched your search

+2 -12
View File
@@ -286,9 +286,7 @@ func (r *ChannelReservation) SetNumConfsRequired(numConfs uint16) {
// of satoshis that can be transferred in a single commitment. This function
// will also attempt to verify the constraints for sanity, returning an error
// if the parameters are seemed unsound.
func (r *ChannelReservation) CommitConstraints(c *channeldb.ChannelConstraints,
capacity btcutil.Amount) error {
func (r *ChannelReservation) CommitConstraints(c *channeldb.ChannelConstraints) error {
r.Lock()
defer r.Unlock()
@@ -343,15 +341,7 @@ func (r *ChannelReservation) CommitConstraints(c *channeldb.ChannelConstraints,
)
}
// Fail if the maxValueInFlight is greater than the channel capacity.
capacityMsat := lnwire.NewMSatFromSatoshis(capacity)
if c.MaxPendingAmount > capacityMsat {
return ErrMaxValueInFlightTooLarge(
c.MaxPendingAmount, capacityMsat,
)
}
// Our dust limit should always be less than or equal our proposed
// Our dust limit should always be less than or equal to our proposed
// channel reserve.
if r.ourContribution.DustLimit > c.ChanReserve {
r.ourContribution.DustLimit = c.ChanReserve