From 228cbd644a78662364f66d03435a0481d3f71131 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Baur" Date: Thu, 2 Mar 2023 10:08:44 +0100 Subject: [PATCH] bigger timeouts for people using tor --- waitforinvoice.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/waitforinvoice.go b/waitforinvoice.go index 585ef9c..87ef472 100644 --- a/waitforinvoice.go +++ b/waitforinvoice.go @@ -22,7 +22,7 @@ import ( var ( TorProxyURL = "socks5://127.0.0.1:9050" Client = &http.Client{ - Timeout: 10 * time.Second, + Timeout: 25 * time.Second, } ) @@ -173,7 +173,7 @@ func WaitForInvoicePaid(payvalues *lnurl.LNURLPayValues, params *Params) { } Client.Transport = specialTransport - var maxiterations = 60 + var maxiterations = 100 ticker := time.NewTicker(1 * time.Second) quit := make(chan struct{}) @@ -223,6 +223,7 @@ func WaitForInvoicePaid(payvalues *lnurl.LNURLPayValues, params *Params) { log.Debug().Str("ZAP", "Published on Nostr").Msg("zapped") publishNostrEvent(nip57Receipt, nip57ReceiptRelays) close(quit) + return } case LNBitsParams: @@ -244,6 +245,7 @@ func WaitForInvoicePaid(payvalues *lnurl.LNURLPayValues, params *Params) { log.Debug().Str("ZAP", "Published on Nostr").Msg("zapped") publishNostrEvent(nip57Receipt, nip57ReceiptRelays) close(quit) + return } case LNPayParams: