Merge pull request #5591 from Crypt-iQ/rest_sendpayment_fix_07302021
rpcserver: validate FinalCltvDelta and CltvLimit for REST
This commit is contained in:
2 files changed
+10
No files matched your search
@@ -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
|
currnet DNS seeds when in SigNet
|
||||||
mode](https://github.com/lightningnetwork/lnd/pull/5564).
|
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
|
## Documentation
|
||||||
|
|
||||||
The [code contribution guidelines have been updated to mention the new
|
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
|
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
|
return payIntent, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user