Commit Graph

38 Commits

Author SHA1 Message Date
87c8165f01 mock: make it possible to set list of returned utxos 2019-07-18 00:58:12 +02:00
10070ecab7 lnwallet: make BlockChainIO.GetUTXO take cancel chan
Use quit channels as cancel chan for call to GetUTXO.
2019-05-09 14:44:47 +02:00
beb5d14ed9 lnwallet/btcwallet: add compile time check for BlockChainIO interface 2019-05-09 14:44:41 +02:00
b53899c43c lnd: rename package main->lnd 2019-04-23 20:57:33 +02:00
6f06c30421 mock: support late registration of spend ntfns 2019-03-19 19:22:47 -07:00
3ebc66bd16 mock: add CreateSimpleTx to mockWalletController 2019-03-15 23:46:50 +01:00
65cdb1294e rpc: recognize the new unused prefix address types 2019-03-05 15:35:28 -08:00
29f07a58cb cnct+lnwl+hswc: use lntypes.Preimage for witness beacon 2019-02-19 17:06:00 -08:00
30f61b7630 multi: make AddPreimage variadic, optimistically compute key
In this commit, we modify the WitnessCache's
AddPreimage method to accept a variadic number
of preimages. This enables callers to batch
preimage writes in performance critical areas
of the codebase, e.g. the htlcswitch.

Additionally, we lift the computation of the
witnesses' keys outside of the db transaction.
This saves us from having to do hashing inside
and blocking other callers, and limits extraneous
blocking at the call site.
2019-02-19 17:05:04 -08:00
9e012ecc93 multi: move Input interface and related code
This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
2019-01-31 13:25:33 +01:00
6389a97708 utxonursery: connect to time-based sweeper
Previously, nursery generated and published its own sweep txes. It
stored the sweep tx in nursery_store to prevent a new tx with a new
sweep address from being generated on restart.

In this commit, sweep generation and publication is removed from nursery
and delegated to the sweeper. Also the confirmation notification is
received from the sweeper.
2018-12-18 10:50:20 +01:00
e14678030c lnwallet: update to new SendOutputs signature 2018-11-10 07:57:19 +01:00
567306b010 Add a maxconfirms argument to ListUnspentWitness
This change was inspired by #1984 - the underlying call to
ListUnspent supports a (min, max) range so it makes sense that
the WalletController interface can also support this; a
default no-maximum can be expressed using a MaxInt32 value.
2018-10-28 15:55:18 +01:00
f594a57c94 lnwallet: remove need for lnwallet to have access to the private key
This paves the way for lnd to work with hardware wallets, in which case it will not have access to the private key.
2018-09-27 20:58:46 -07:00
1ffc3bb82e multi: update to latest RegisterBlockEpochNtfn interface 2018-08-10 01:08:57 -07:00
d2612e51bd Merge pull request #1644 from wpaulino/kw-fees
multi: switch to sat/kw fees
2018-08-09 20:19:28 -07:00
d64bb5921e Merge pull request #1635 from halseth/funding-broadcast-fail
Move funding tx broadcasting to Fundingmanager
2018-08-09 20:04:30 -07:00
9d2eeb6304 multi: update to latest fee estimation interface 2018-08-09 17:29:52 -07:00
067db8572c test+lnd: update unit test mocks to adhere to new interface API's 2018-07-31 21:28:58 -07:00
07defe5f93 rpc+peer: use pkScripts for close ntfns 2018-07-31 21:28:52 -07:00
3afa16b7a6 mock: make ListUnspentWitness return new outpoints each call 2018-07-31 14:53:21 +02:00
d7b2977e8c multi test: remove mempool bool from RegisterSpendNtfn 2018-07-22 23:09:08 +02:00
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
60d9ae02c7 mock: protect mockSpendNotifier map by mutex 2018-06-15 12:11:13 +02:00
ed6682ea4a multi test: make mock adhere to api change 2018-04-03 22:04:02 +02:00
1669e3d5ec lnd: use first key in keychain.KeyFamilyNodeKey as our nodeID
In this commit, we update lnd to now access the deterministic
keychain.KeyRing struct in order to obtain our identity public key.
With this change, if the user recovers their wallet with the same seed,
then they’ll have access to the same prior node identity. This change
also makes it easy for us to support node key rotation in the future by
bumping up our requested index.
2018-03-06 16:04:04 -05:00
4b20e805fe multi: update packages due to recent SignDescriptor and WalletController changes 2018-03-06 16:04:03 -05:00
7b30425111 multi test: update tests/mocks to use EstimateFeePerVSize 2018-02-26 22:42:27 +01:00
84551c616f lnwallet/lnrpc: Expose sync status to gRPC interface
This commit adds wallet_best_block_timestamp to the gRPC interface.
This is done in order to allow clients to calculate progress while
lnd syncs to the blockchain. wallet_best_block_timestamp is exposed
via the GetInfo() rpc call. Additionally, IsSynced() returns the
WalletBestBlockTimestamp as the second value in the tuple
that is returned, providing additional detail when querying about the
status of the sync. The BtcWallet interface has also been updated
accordingly.

This commit was created to support the issue to
[Add progress bar for chain sync] (lightninglabs/lightning-app#10) in
lightning-app
2018-02-20 19:00:06 -08:00
2faafbcd93 breacharbiter: properly account for second-level spends during breach remedy
In this commit, we address an un accounted for case during the breach
remedy process. If the remote node actually went directly to the second
layer during a channel breach attempt, then we wouldn’t properly be
able to sweep with out justice transaction, as some HTLC inputs may
actually be spent at that point.

In order to address this case, we’ll now catch the transaction
rejection, then check to see which input was spent, promote that to a
second level spend, and repeat as necessary. At the end of this loop,
any inputs which have been spent to the second level will have had the
prevouts and witnesses updated.

In order to perform this transition, we now also store the second level
witness script in the database. This allow us to modify the sign desc
with the proper input value, as well as witness script.
2018-01-22 19:20:01 -08:00
b391049e49 lnd+test: update unit tests to account for recent API changes 2018-01-22 19:19:46 -08:00
9a02884d0b main/lntest: factor out node config options, add options for bitcoind
This commit factors out the btcd and ltcd options into their own sections
similar to neutrino, and adds a bitcoind section as well. Now, you specify
node options similarly to:

--ltcd.rpchost=...
or
--btcd.rpcuser=...
or
--bitcoind.zmqpath=...

For Bitcoin, you specify an alternate back-end to btcd as follows:

--bitcoin.node=bitcoind
or
--bitcoin.node=neutrino

You can also specify the default option:
--bitcoin.node=btcd

For Litecoin, only `btcd` mode is valid, and corresponds to the `ltcd`
section. For example:

--litecoin.node=btcd
--ltcd.rpchost=...

The new code also attempts to read the correct options and auth info
from bitcoin.conf just as it does from btcd.conf/ltcd.conf.
2018-01-15 13:59:34 -08:00
20738885ef mock: adds mockSpendNotifier and updates mockSigner 2018-01-05 13:47:17 -08:00
a3cd248404 funding+utxonursery+breacharbiter: use new FeeEstimator API 2017-11-23 23:10:13 -06:00
f5e324684f test: use signDesc.HashType instead of SigHashAll in mockSigner 2017-11-06 14:31:23 +01:00
c94130328a lnwallet: Extend Utxo struct with AddressType.
The Utxo struct now includes the address type and redeem/witness
scripts. This is necessary for accurate fee estimation.
2017-10-19 17:37:53 -07:00
7f575b688e multi: txscript.WitnessScript -> txscript.WitnessSignature 2017-08-24 18:55:32 -07:00
e8e87322dd peer: add channel close fee negotiation
This commit adds the fee negotiation procedure performed
on channel shutdown. The current algorithm picks an ideal
a fee based on the FeeEstimator and commit weigth, then
accepts the remote's fee if it is at most 50%-200% away
from the ideal. The fee negotiation procedure is similar
both as sender and receiver of the initial shutdown
message, and this commit also make both sides use the
same code path for handling these messages.
2017-08-11 12:10:32 +02:00