client: fill LastHop in FetchSwaps

Loop used to "forget" last_hop of swaps created before its restart.
The commit fixes this.

Added test TestFetchSwapsLastHop for this. Filled field abandonChans in test
utility function newSwapClient because the field is used in new test.

Fixes https://github.com/lightninglabs/loop/issues/798
This commit is contained in:
Boris Nagaev 2024-08-07 22:52:02 -03:00
parent 8c97c60bb4
commit ed3db3bab2
No known key found for this signature in database
3 changed files with 76 additions and 0 deletions

View file

@ -108,6 +108,7 @@ func newSwapClient(t *testing.T, config *clientConfig) *Client {
sweeper: sweeper,
executor: executor,
resumeReady: make(chan struct{}),
abandonChans: make(map[lntypes.Hash]chan struct{}),
}
}