From 3036fc01817eedd1821c2945e04c0e79b69a8453 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 28 Jan 2018 15:11:13 -0800 Subject: [PATCH] lnwallet: disallow creation of channels < 2x dust limit Fixes #633. --- lnwallet/reservation.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnwallet/reservation.go b/lnwallet/reservation.go index 51f91298..84f59182 100644 --- a/lnwallet/reservation.go +++ b/lnwallet/reservation.go @@ -184,11 +184,11 @@ func NewChannelReservation(capacity, fundingAmt, commitFeePerKw btcutil.Amount, } // If we're the initiator and our starting balance within the channel - // after we take account of fees is below dust, then we'll reject this - // channel creation request. + // after we take account of fees is below 2x the dust limit, then we'll + // reject this channel creation request. // // TODO(roasbeef): reject if 30% goes to fees? dust channel - if initiator && ourBalance.ToSatoshis() <= DefaultDustLimit() { + if initiator && ourBalance.ToSatoshis() <= 2*DefaultDustLimit() { return nil, fmt.Errorf("unable to init reservation, with "+ "fee=%v sat/kw, local output is too small: %v sat", int64(commitFee), int64(ourBalance.ToSatoshis()))