funding: implement reservation zombie sweeper

Before previous commits were squashed into this commit, zombie
reservations were cleaned up individually when they timed out.
However, this made the code more complex because each reservation
had its own individual timer and thus it would have required the
timer being cancelled any time the reservation was cancelled,
which would have been harder to maintain. With this commit,
zombie reservations are cleaned up by a zombie sweeper that is
set off by a ticker instead, to make the code more maintainable.
This commit is contained in:
PaddyQuinn committed 2018-03-12 21:58:51 -04:00
1 parent 5410725306
commit 75e45b830b
2 files changed
+95 -8

No files matched your search

+2
View File
@@ -414,6 +414,8 @@ func lndMain() error {
// channel bandwidth.
return uint16(lnwallet.MaxHTLCNumber / 2)
},
ZombieSweeperInterval: 1 * time.Minute,
ReservationTimeout: 10 * time.Minute,
})
if err != nil {
return err