lnwallet+funding+lnd: add new config option for min accepted channel size
In this commit we add a new command line option (and a sane default) to allow users to specify the *smallest* inbound channel that they'll accept. Having a higher-ish limit lets users limit their channels, and also avoid a series of very low value "spam" channels. The new option is --minchansize, and expressed in satoshis. If we receive an inbound channel request for a value smaller than this, then we'll immediately reject it.
This commit is contained in:
4 files changed
+45
-15
No files matched your search
@@ -106,3 +106,13 @@ func ErrMaxValueInFlightTooSmall(maxValInFlight,
|
||||
maxValInFlight, minMaxValInFlight),
|
||||
}
|
||||
}
|
||||
|
||||
// ErrChanTooSmall returns an error indicating that an incoming channel request
|
||||
// was too small. We'll reject any incoming channels if they're below our
|
||||
// configured value for the min channel size we'll accept.
|
||||
func ErrChanTooSmall(chanSize, minChanSize btcutil.Amount) ReservationError {
|
||||
return ReservationError{
|
||||
fmt.Errorf("chan size of %v is below min chan size of %v",
|
||||
chanSize, minChanSize),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user