funding+lnwallet: validate ChannelReserve is above DustLimit
This is necessary and is implied by BOLT#02. Both ChannelReserve parameters should be above both DustLimit parameters. Otherwise, it is possible for one side to have nothing at stake.
This commit is contained in:
5 files changed
+81
-14
No files matched your search
@@ -152,6 +152,14 @@ func ErrChanTooLarge(chanSize, maxChanSize btcutil.Amount) ReservationError {
|
||||
}
|
||||
}
|
||||
|
||||
// ErrInvalidDustLimit returns an error indicating that a proposed DustLimit
|
||||
// was rejected.
|
||||
func ErrInvalidDustLimit(dustLimit btcutil.Amount) ReservationError {
|
||||
return ReservationError{
|
||||
fmt.Errorf("dust limit %v is invalid", dustLimit),
|
||||
}
|
||||
}
|
||||
|
||||
// ErrHtlcIndexAlreadyFailed is returned when the HTLC index has already been
|
||||
// failed, but has not been committed by our commitment state.
|
||||
type ErrHtlcIndexAlreadyFailed uint64
|
||||
|
||||
Reference in new issue
Block a user