mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-15 03:51:23 +01:00
parent
1b5655f7fa
commit
281f6daccb
1 changed files with 8 additions and 6 deletions
14
rpcserver.go
14
rpcserver.go
|
@ -4429,15 +4429,17 @@ func (r *rpcServer) UpdateChannelPolicy(ctx context.Context,
|
||||||
return nil, fmt.Errorf("unknown scope: %v", scope)
|
return nil, fmt.Errorf("unknown scope: %v", scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
// As a sanity check, we'll ensure that the passed fee rate is below
|
switch {
|
||||||
// 1e-6, or the lowest allowed fee rate, and that the passed timelock
|
// As a sanity check, if the fee isn't zero, we'll ensure that the
|
||||||
// is large enough.
|
// passed fee rate is below 1e-6, or the lowest allowed non-zero fee
|
||||||
if req.FeeRate < minFeeRate {
|
// rate expressible within the protocol.
|
||||||
|
case req.FeeRate != 0 && req.FeeRate < minFeeRate:
|
||||||
return nil, fmt.Errorf("fee rate of %v is too small, min fee "+
|
return nil, fmt.Errorf("fee rate of %v is too small, min fee "+
|
||||||
"rate is %v", req.FeeRate, minFeeRate)
|
"rate is %v", req.FeeRate, minFeeRate)
|
||||||
}
|
|
||||||
|
|
||||||
if req.TimeLockDelta < minTimeLockDelta {
|
// We'll also ensure that the user isn't setting a CLTV delta that
|
||||||
|
// won't give outgoing HTLCs enough time to fully resolve if needed.
|
||||||
|
case req.TimeLockDelta < minTimeLockDelta:
|
||||||
return nil, fmt.Errorf("time lock delta of %v is too small, "+
|
return nil, fmt.Errorf("time lock delta of %v is too small, "+
|
||||||
"minimum supported is %v", req.TimeLockDelta,
|
"minimum supported is %v", req.TimeLockDelta,
|
||||||
minTimeLockDelta)
|
minTimeLockDelta)
|
||||||
|
|
Loading…
Add table
Reference in a new issue