Commit graph

17 commits

Author SHA1 Message Date
Oliver Gugger
986d889b74
multi: fix linter issues 2022-08-03 20:33:06 +02:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
positiveblue
1856f798fc
account/watcher: add ExpiryWatcher tests 2021-12-07 12:22:38 -08:00
positiveblue
17e77c380f
account/watcher: add controller tests 2021-12-07 12:22:37 -08:00
positiveblue
739498543a
mocks: add account/watcher mocks 2021-12-07 12:22:37 -08:00
positiveblue
7b53791997
account/watcher: delete expiryReq 2021-12-07 12:22:37 -08:00
positiveblue
abd603d765
account/watcher: add ExpiryWatcher and EventHandler interfaces
Split watcher logic in three pices:
    - Controller: API + message dispatching
    - ExpiryWatcher: handle account expirations
    - EventHandler: implementation for each handler
2021-12-07 12:22:27 -08:00
positiveblue
a34790e494
account/watcher: add Controller interface
Use the new watcher interface in the account manager instead of of a specific
struct type.
2021-12-07 11:58:40 -08:00
Wilmer Paulino
d3dc8f9ffc
watcher: overwrite request on successive calls to WatchAccountExpiration 2021-01-08 14:02:20 +01:00
Wilmer Paulino
7d8602b0ee
watcher: use single mutex to track request cancellations 2021-01-08 14:02:18 +01:00
Wilmer Paulino
ad9ef3f3ff
log+watcher: avoid log of manual context canceled error 2020-11-24 10:59:06 -08:00
Oliver Gugger
fa05add3b7
account+rpcserver: handle consecutive batch confirmations
This commit allows the account manager to handle the situation where
an account participates in multiple consecutive batches that might still
be in the mempool. Once the first batch confirms, the database state of
the account might differ from the batch key used in that earlier batch.
We need to cancel old spend and conf watches and only watch the latest
batch for confirmation. While an account is in this pending batch state, no
user modification like deposits or withdrawals are allowed so it's safe
to just jump to the latest batch and wait for confirmations on that one.
2020-08-17 13:53:04 +02:00
Oliver Gugger
978950600c
multi: update aperture, use lndclient, remove loop
To get rid of the loop dependency, we update aperture (which now houses
all the LSAT code) and use the standalone lndclient repository.
2020-08-11 19:41:01 +02:00
Oliver Gugger
64ccc3ae63 client+watcher: cancel contexts on shutdown 2020-03-04 15:16:56 +01:00
Wilmer Paulino
3323968d44 watcher: wait for initial block notification before handling requests
Otherwise, it's possible for an expiry request to be handled before the
first block notification that sets our best height is received, causing
us to not fulfill the request if the corresponding expiry had already
been reached.
2020-02-05 11:56:29 -08:00
Wilmer Paulino
004e1cf857 multi: use btcec.PublicKey instead of [33]byte
This allows us to use utility functions that require the use of a parsed
public key without needing to parse every time.
2020-01-24 13:45:48 -08:00
Wilmer Paulino
a3f00165e9 watcher: implement subsystem to watch accounts on-chain
This was done in a generic way so that it could be used for both the
client and server.
2020-01-08 13:01:38 -08:00