Skip to content

Commit

Permalink
Schedule checkPaymentsTimeout every 10s (#320)
Browse files Browse the repository at this point in the history
With the previous interval of 30s, a payment could stay pending for up
to 90s in the worst case scenario. This opens edge cases with the
pay-to-open logic, where expired pending parts could be taken into
account when processing other parts with the same payment hash.

cherry-picked from #62c59d6
  • Loading branch information
pm47 authored and dpad85 committed Feb 8, 2022
1 parent 13c7143 commit 81bcbcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class Peer(

suspend fun checkPaymentsTimeout() {
while (isActive) {
delay(Duration.seconds(30))
delay(Duration.seconds(10)) // we schedule a check every 10 seconds
input.send(CheckPaymentsTimeout)
}
}
Expand Down

0 comments on commit 81bcbcd

Please sign in to comment.