funding+lnwallet: ensure max_htlc_value_in_flight smaller than capacity

Return an error to the remote if larger.
This commit is contained in:
Johan T. Halseth committed 2019-01-22 08:42:29 +01:00
1 parent f8e588e2e3
commit 4aa52d267f
4 files changed
+38 -8

No files matched your search

+10
View File
@@ -132,6 +132,16 @@ func ErrNumConfsTooLarge(numConfs, maxNumConfs uint32) error {
}
}
// ErrMaxValueInFlightTooLarge returns an error indicating that the 'max HTLC
// value in flight' the remote required is too large to be accepted.
func ErrMaxValueInFlightTooLarge(maxValInFlight,
maxMaxValInFlight lnwire.MilliSatoshi) ReservationError {
return ReservationError{
fmt.Errorf("maxValueInFlight too large: %v, max is %v",
maxValInFlight, maxMaxValInFlight),
}
}
// 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.