Skip to content

Commit 7866e13

Browse files
committed
chore: use SEND_PAYMENT_TIMEOUT constant
1 parent cdc3cb4 commit 7866e13

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

constants/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const (
4747
// accounting for encryption and other metadata in the response, this is set to 4096 characters
4848
const INVOICE_METADATA_MAX_LENGTH = 4096
4949

50+
const SEND_PAYMENT_TIMEOUT = 50
51+
5052
// errors used by NIP-47 and the transaction service
5153
const (
5254
ERROR_INTERNAL = "INTERNAL"

lnclient/ldk/ldk.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/sirupsen/logrus"
2727

2828
"github.com/getAlby/hub/config"
29+
"github.com/getAlby/hub/constants"
2930
"github.com/getAlby/hub/events"
3031
"github.com/getAlby/hub/lnclient"
3132
"github.com/getAlby/hub/logger"
@@ -436,7 +437,7 @@ func getMaxTotalRoutingFeeLimit(amountMsat uint64) ldk_node.MaxTotalRoutingFeeLi
436437
}
437438

438439
func (ls *LDKService) SendPaymentSync(ctx context.Context, invoice string, amount *uint64, timeoutSeconds *int64) (*lnclient.PayInvoiceResponse, error) {
439-
sendPaymentTimeout := int64(50)
440+
sendPaymentTimeout := int64(constants.SEND_PAYMENT_TIMEOUT)
440441
if timeoutSeconds == nil {
441442
timeoutSeconds = &sendPaymentTimeout
442443
}

lnclient/lnd/lnd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"google.golang.org/grpc/status"
2020

2121
"github.com/getAlby/hub/config"
22+
"github.com/getAlby/hub/constants"
2223
"github.com/getAlby/hub/events"
2324
"github.com/getAlby/hub/lnclient"
2425
"github.com/getAlby/hub/lnclient/lnd/wrapper"
@@ -287,7 +288,7 @@ func (svc *LNDService) Shutdown() error {
287288
func (svc *LNDService) SendPaymentSync(ctx context.Context, payReq string, amount *uint64, timeoutSeconds *int64) (*lnclient.PayInvoiceResponse, error) {
288289
const MAX_PARTIAL_PAYMENTS = 16
289290

290-
sendPaymentTimeout := int64(50)
291+
sendPaymentTimeout := int64(constants.SEND_PAYMENT_TIMEOUT)
291292
if timeoutSeconds == nil {
292293
timeoutSeconds = &sendPaymentTimeout
293294
}

0 commit comments

Comments
 (0)