mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-27 23:46:17 +02:00
Merge pull request #5591 from Crypt-iQ/rest_sendpayment_fix_07302021
rpcserver: validate FinalCltvDelta and CltvLimit for REST
This commit is contained in:
@@ -150,6 +150,8 @@ A bug has been fixed that would cause `lnd` to [try to bootstrap using the
|
||||
currnet DNS seeds when in SigNet
|
||||
mode](https://github.com/lightningnetwork/lnd/pull/5564).
|
||||
|
||||
[A validation check for sane `CltvLimit` and `FinalCltvDelta` has been added for `REST`-initiated payments.](https://github.com/lightningnetwork/lnd/pull/5591)
|
||||
|
||||
## Documentation
|
||||
|
||||
The [code contribution guidelines have been updated to mention the new
|
||||
|
@@ -4339,6 +4339,14 @@ func (r *rpcServer) extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPayme
|
||||
return payIntent, err
|
||||
}
|
||||
|
||||
// Do bounds checking with the block padding.
|
||||
err = routing.ValidateCLTVLimit(
|
||||
payIntent.cltvLimit, payIntent.cltvDelta, true,
|
||||
)
|
||||
if err != nil {
|
||||
return payIntent, err
|
||||
}
|
||||
|
||||
return payIntent, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user