Skip to content

Commit 5eafb75

Browse files
committed
chore: reverse timeout seconds
1 parent 7866e13 commit 5eafb75

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lnclient/ldk/ldk.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ func getMaxTotalRoutingFeeLimit(amountMsat uint64) ldk_node.MaxTotalRoutingFeeLi
438438

439439
func (ls *LDKService) SendPaymentSync(ctx context.Context, invoice string, amount *uint64, timeoutSeconds *int64) (*lnclient.PayInvoiceResponse, error) {
440440
sendPaymentTimeout := int64(constants.SEND_PAYMENT_TIMEOUT)
441-
if timeoutSeconds == nil {
442-
timeoutSeconds = &sendPaymentTimeout
441+
if timeoutSeconds != nil {
442+
sendPaymentTimeout = *timeoutSeconds
443443
}
444444

445445
paymentRequest, err := decodepay.Decodepay(invoice)
@@ -491,7 +491,7 @@ func (ls *LDKService) SendPaymentSync(ctx context.Context, invoice string, amoun
491491
fee := uint64(0)
492492
preimage := ""
493493

494-
timeout := time.Second * time.Duration(*timeoutSeconds)
494+
timeout := time.Second * time.Duration(sendPaymentTimeout)
495495
timer := time.NewTimer(timeout)
496496
defer timer.Stop()
497497

lnclient/lnd/lnd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ func (svc *LNDService) SendPaymentSync(ctx context.Context, payReq string, amoun
289289
const MAX_PARTIAL_PAYMENTS = 16
290290

291291
sendPaymentTimeout := int64(constants.SEND_PAYMENT_TIMEOUT)
292-
if timeoutSeconds == nil {
293-
timeoutSeconds = &sendPaymentTimeout
292+
if timeoutSeconds != nil {
293+
sendPaymentTimeout = *timeoutSeconds
294294
}
295295

296296
paymentRequest, err := decodepay.Decodepay(payReq)
@@ -308,7 +308,7 @@ func (svc *LNDService) SendPaymentSync(ctx context.Context, payReq string, amoun
308308
sendRequest := &routerrpc.SendPaymentRequest{
309309
PaymentRequest: payReq,
310310
MaxParts: MAX_PARTIAL_PAYMENTS,
311-
TimeoutSeconds: int32(*timeoutSeconds),
311+
TimeoutSeconds: int32(sendPaymentTimeout),
312312
FeeLimitMsat: int64(transactions.CalculateFeeReserveMsat(paymentAmountMsat)),
313313
}
314314

0 commit comments

Comments
 (0)