This commit bumps the compile time dependency of lnd and lndclient to
the 0.16.x branch. This makes the code forward compatible but does not
yet change anything with respect to the minimum required version the
user needs to run.
This commit reformulates transaction labels as JSON strings. The JSON contains the following fields:
* An `action` field which takes one of the following values: create, deposit, withdraw, renew, or close.
* `key` which is the account key.
* `expiry_height` which is an integer block height at which the account expires. This value is important to ease the process of account recovery.
* `output_index` which is an integer denoting the account balance transaction output.
* `expiry_spend` which is a boolean denoting whether the transaction spends via the expiry output path.
* `tx_fee` which is the onchain transaction fee for executing the account action.
* `balance_diff` which is a signed integer denoting the difference (+/-) in the account balance as a result of the transaction.
The poold specific transaction label prefix tag is also modified such that its prefixes spaces are removed.
The `.UnsignedTx` of a psbt does not include the related
SignatureScripts. Because SignatureScripts are not part of the signed
data, the partial signature for a psbt that does not include them is a
valid signature. However, the `TxHash` will change between a tx that has
SignatureScripts set and one that does not.
This behaviour led the auctioneer and the client to record the wrong
outpoint when using np2wkh.
With this commit we streamline the signing code somewhat to make it
easier to understand. With the new flow the spendPkg struct is no longer
needed as we directly pass back the (partially) signed TX.
Fixes#372.
This commit fixes the issue that if the lnd node the trader client is
connected to was also restored from seed, it is starting at account key
derivation index 0. So when recovering accounts we need to make sure we
re-derive the right number of keys from the wallet in order to allow
properly creating new accounts with the recovered node.
Split watcher logic in three pices:
- Controller: API + message dispatching
- ExpiryWatcher: handle account expirations
- EventHandler: implementation for each handler
If the account is currently participating in a batch
(`StatePendingBatch`) we disable the renewAccount command. After
enabling account autorenew it could be problematic to renew your
account before the batch is confirmed and you account expiry height
gets updated.
If `poold` is using a different `lndclient.SignerClient` than the one
used during an account creation it won't be able to generate valid
signatures. `poold` wasn't checking the signatures before sending them
to the backend and it was sending invalid
`ClientAuctionMessage_Subscribe` messages.
With this change `poold` will detect invalid signatures before sending
them, instead of waiting for the backend to send back an error.
Generally the confirmation target is much less granular than a direct sat/byte
due to jumps in the confirmation confidence intervals. Changed the
account manager to take the `feeRate` instead of the `confTarget`. The
caller will be the one with the responsability of calculating the
`freeRate`. If the caller does not provide a value (`freeRate=0`) we
will calculate it from the default confTarget (6 blocks).
This commit bumps pool to lndclient 13-7 so that code that depends
on lnd 0.13 can import pool. As is, pool is running with lndclient 0.12,
but pins minimum version to 0.11, so we are already in a state where
some of the apis available at compile time are not enforced by minimum
run version.
This commit bumps this minimum version up to 0.12 to minimize the
difference between the compile and runtime lnd version.
The name SubscribeAccountUpdates could indicate that this is a
long-running operation. The method returns after successful
authentication of the stream though. That's why we rename it to
StartAccountSubscription and update the comment to make it more clear
that this should return after a few seconds at the most.
Unfortunately there are two error messages that are very similar (the
only difference is "doesn't" vs. "does not") and can both be returned,
depending on the code path taken.
This is an intermediate state where an account has met its expiration
while having a pending update waiting for confirmation. The introduction
of this state was necessary as the existing StateExpired state was not
sufficient to handle all edge cases regarding account renewals. Now
that this state exists, we can be sure renewals cannot happen until the
account is both confirmed, unspent, and expired.