rpc: use more sensible final cltv delta default when sending payments

This commit is contained in:
Joost Jager 2020-01-10 10:25:53 +01:00
parent 59a7a9d308
commit d3fa9767a9
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

View File

@ -3535,7 +3535,11 @@ func (r *rpcServer) extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPayme
if rpcPayReq.FinalCltvDelta != 0 {
payIntent.cltvDelta = uint16(rpcPayReq.FinalCltvDelta)
} else {
payIntent.cltvDelta = zpay32.DefaultFinalCLTVDelta
// If no final cltv delta is given, assume the default that we
// use when creating an invoice. We do not assume the default of
// 9 blocks that is defined in BOLT-11, because this is never
// enough for other lnd nodes.
payIntent.cltvDelta = uint16(cfg.Bitcoin.TimeLockDelta)
}
// If the user is manually specifying payment details, then the payment