Skip to content

Commit

Permalink
try less routes by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Jan 28, 2020
1 parent 226f088 commit 72f8541
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ func (ln *Client) InvoiceWithDescriptionHash(
return btcec.SignCompact(btcec.S256(), privKey, hash, true)
},
})

return
}
6 changes: 3 additions & 3 deletions payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"fmt"
"time"

"github.com/fiatjaf/ln-decodepay/gjson"
decodepay_gjson "github.com/fiatjaf/ln-decodepay/gjson"
"github.com/tidwall/gjson"
)

var WaitSendPayTimeout = time.Hour * 24 * 30
var WaitPaymentMaxAttempts = 60
var WaitPaymentMaxAttempts = 15

// PayAndWaitUntilResolution implements its 'pay' logic, querying and retrying routes.
// It's like the default 'pay' plugin, but it blocks until a final success or failure is achieved.
Expand Down Expand Up @@ -121,7 +121,7 @@ func tryPayment(
maxdelaytotal int,
hint *gjson.Result,
) (paid bool, payment gjson.Result) {
for try := 0; try < 40; try++ {
for try := 0; try < WaitPaymentMaxAttempts; try++ {
if !time.Now().Before(startTime.Add(5 * time.Minute)) {
// if a previous try (or sum of tries) was pending for more than 5 minutes we won't try anything after
return
Expand Down

0 comments on commit 72f8541

Please sign in to comment.