wtclient: ensure correct disk mode for overflow queue

Before this commit, in the watchtower client's DiskOverflowQueue, there
could be a situation _if no consumer was reading from the queue_ that
could lead to an in-memory build up of backup tasks instead of the
expected disk overflow. This commit fixes this by ensuring that if a
task is read from disk, then the mode is set to disk mode to ensure that
any new items are persisted to disk in this scenario.
The unit tests added in the previous commit is updated here in order to
show that the fix does in-fact fix the test.
This commit is contained in:
Elle Mouton committed 2024-01-15 17:28:17 +02:00
1 parent d4fefda10a
commit 3d201dde50
3 files changed
+28 -14

No files matched your search

+4 -1
View File
@@ -49,7 +49,7 @@
same exclusive group](https://github.com/lightningnetwork/lnd/pull/7800).
When using neutrino as a backend unconfirmed transactions have to be
removed from the wallet when a conflicting tx is confirmed. For other backends
these unconfirmed transactions are already removed. In addition a new
these unconfirmed transactions are already removed. In addition, a new
walletrpc endpoint `RemoveTransaction` is introduced which let one easily
remove unconfirmed transaction manually.
@@ -61,6 +61,9 @@
this buffer which can be used to increase the commitment fee and it also
protects against the case where htlcs are added asynchronously resulting in
stuck channels.
* [Fixed](https://github.com/lightningnetwork/lnd/pull/8377) a watchtower client
test flake that prevented new tasks from overflowing to disk.
* [Properly handle un-acked updates for exhausted watchtower
sessions](https://github.com/lightningnetwork/lnd/pull/8233)