Commit Graph

6537 Commits

Author SHA1 Message Date
Conner Fromknecht
05e3a7f6c0
watchtower/wtmock/peer: set local pubkey 2019-03-15 02:34:00 -07:00
Conner Fromknecht
80040d9d96
watchtower/wtclient/client_test: adds client-server upload test 2019-03-15 02:33:47 -07:00
Conner Fromknecht
e1e805d1b8
watchtower/wtserver/server: fix race condition on Stop 2019-03-15 02:33:33 -07:00
Conner Fromknecht
a222a63d81
watchtower/wtserver/server: no ack updates 2019-03-15 02:33:20 -07:00
Conner Fromknecht
8b0cc487f0
watchtower/wtdb+wtserver: allow retransmission of last update 2019-03-15 02:33:06 -07:00
Conner Fromknecht
81497eceaf
watchtower/wtmock/peer: create mock net.Conn using bidi MockPeer 2019-03-15 02:32:53 -07:00
Conner Fromknecht
87e8700c5d
watchtower/wtmock/client_db: add mock client db 2019-03-15 02:32:40 -07:00
Conner Fromknecht
f00b4c5e96
watchtower/wtclient/client: hook up full client pipeline 2019-03-15 02:32:27 -07:00
Conner Fromknecht
abef9e09e7
watchtower/wtclient/stats: adds clientStats 2019-03-15 02:32:15 -07:00
Conner Fromknecht
aa2b21117c
watchtower/wtclient/session_queue: batch upload state updates 2019-03-15 02:32:02 -07:00
Conner Fromknecht
65d09fca64
watchtower/wtclient/task_pipeline: add reliable task aggregator 2019-03-15 02:31:50 -07:00
Conner Fromknecht
95fa7659e0
watchtower/wtclient/session_negotiator: add session negotiation 2019-03-15 02:31:37 -07:00
Conner Fromknecht
a8721bcedf
watchtower/wtclient/tower_candidate_iterator: linked-list iterator 2019-03-15 02:31:24 -07:00
Conner Fromknecht
b23bff62d5
watchtower/wtclient/errors 2019-03-15 02:31:11 -07:00
Conner Fromknecht
4642954e72
watchtower/wtclient/backup_task: bind to ClientSession instead of SessionInfo 2019-03-15 02:30:59 -07:00
Conner Fromknecht
b1903451d9
watchtower/wtclient/interface: add DB ifaces 2019-03-15 02:30:47 -07:00
Conner Fromknecht
04bbf39f51
watchtower/wtclient/log: adds wtclient logging 2019-03-15 02:30:35 -07:00
Conner Fromknecht
9177358a3c
watchtower/wtdb/client_session: add ClientSession 2019-03-15 02:30:22 -07:00
Conner Fromknecht
247978dfe2
watchtower/wtdb/tower: store wt pk and addrs 2019-03-15 02:30:09 -07:00
Conner Fromknecht
99dbbf48aa
watchtower/wtwire/error_code: add human-readable descriptors 2019-03-15 02:29:55 -07:00
Conner Fromknecht
9c70f49901
watchtower/wtwire/create_session_reply: remove extra Reject from code 2019-03-15 02:29:42 -07:00
Olaoluwa Osuntokun
36cc1da8ea
Merge pull request #2633 from halseth/autpilot-chansize-allocation
[autopilot] distribute available funds among channels
2019-03-14 12:51:02 -07:00
Johan T. Halseth
fb5b6ff425
autopilot/agent_test: add TestAgentChannelSizeAllocation
TestAgentChannelSizeAllocation tests that the autopilot agent opens
channel of size that stays within the channel budget and size
restrictions.
2019-03-14 08:49:28 +01:00
Johan T. Halseth
b71f4632a6
autopilot/agent_test: define testCtx, setup, other helpers
This commit defines a set of helper methods that are used by many of the existing tests.
2019-03-14 08:49:28 +01:00
Johan T. Halseth
4a1e06b204
autopilot/agent: distribute available funds among channels
This commit fixes a regression in how we allocate funds to attempted
channels. We would earlier stay within the channel size limits, but we
wouldn't account for funds consumed by other channels being opened in
parallel.

We fix this by introducing a loop which greadily tries to distribute the
funds among the channels to open, and reduces the number of channels to
open in case not enough funds are available to satisfy the channel size
limits.
2019-03-14 08:49:28 +01:00
Olaoluwa Osuntokun
c1228ae15f
Merge pull request #2671 from wpaulino/tx-broadcast-err-handling
lnwallet/btcwallet: remove invalid transactions from the wallet when broadcast fails
2019-03-13 21:03:04 -07:00
Wilmer Paulino
7946d0a256
multi: remove ErrDoubleSpend check for PublishTransaction
In this commit, we address a lingering issue within some subsystems that
are responsible for broadcasting transactions. Previously,
ErrDoubleSpend indicated that a transaction was already included in the
mempool/chain. This error was then modified to actually be returned for
conflicting transactions, but its callers were not modified accordingly.
This would lead to conflicting transactions to be interpreted as valid,
when they shouldn't be.
2019-03-13 17:57:19 -07:00
Wilmer Paulino
5c5c542f94
lnwallet/btcwallet: remove unnecessary tx in mempool/chain checks
The checks to determine whether the transaction broadcast failed due to
it already existing in the mempool/chain are no longer needed since the
underlying btcwallet PublishTransaction call will not return an error
when running into these cases.
2019-03-13 17:57:19 -07:00
Olaoluwa Osuntokun
10910318a2
lnd: extract neutrino initialization to new function 2019-03-13 17:20:38 -07:00
Wilmer Paulino
1fe6599fd8 lnd+chainregistry: initialize neutrino light client before wallet setup
In this commit, we slightly refactor the startup of lnd when running
with a Neutrino light client backend. We'll now begin syncing our
backend as soon as lnd starts and passes all configuration checks. Since
this is all done before lnd's wallet setup, the light client will be
syncing in the background while the user notes/inputs their wallet seed.
This is done in order to provide a better UX from the point of the user,
such that most of the chain will already be synced by the time they get
to deposit funds into the wallet.
2019-03-13 16:46:50 -07:00
Olaoluwa Osuntokun
d0757221b4
Merge pull request #2768 from Roasbeef/neutrino-rescan-btcwallet-broadcast-update
multi: update build to latest version of neutrino+btcwallet
2019-03-13 16:39:23 -07:00
Olaoluwa Osuntokun
d86fe393cd
multi: update build to latest version of neutrino+btcwallet
In this commit, we update the build to point to the latest version of
neutrino and btcwallet. The latest version of neutrino includes a number
of bug fixes, and new features like reliably transaction broadcast. The
latest version of btcwallet contains a number of bug fixes related to
properly remove invalid transactions from its database.
2019-03-13 15:03:39 -07:00
Olaoluwa Osuntokun
a24eeb9135
lnrpc/routerrpc: style fix ups 2019-03-12 21:20:21 -07:00
Olaoluwa Osuntokun
ad8849056b
Merge pull request #2497 from joostjager/querysingleroute
lnrpc: deprecate QueryRoutes with more than one route
2019-03-12 21:15:18 -07:00
Wilmer Paulino
3371c5fab0
Merge pull request #2680 from grunch/passwd-length-validation-on-create-wallet
Add password length validation condition on create wallet cli
2019-03-12 12:12:54 -07:00
chokoboko
69d3c47d22 multi: inspect missed errors in scoped if statements 2019-03-11 13:23:21 -07:00
Joost Jager
293971cd03
routerrpc: move query routes into sub server
This commit moves the query routes backend logic from the main
rpc server into the sub server. It is another step towards splitting up
the main rpc server code.

In addition to this, a unit test is added to verify rpc parameter
parsing.
2019-03-11 09:56:16 +01:00
Olaoluwa Osuntokun
cfb5e249b9
Merge pull request #2749 from Roasbeef/bork-force-close
lnwallet: within ForceClose, mark the channel as borked, prevent mutations for borked channels
2019-03-10 15:21:09 -07:00
Olaoluwa Osuntokun
33ad645f8c
lnwallet: update TestChanSyncFailure to pass with new borked update restriction
In this commit, we update the `TestChanSyncFailure` method to pass given
the new behavior around updating borked channel states. In order to do
this, we add a new method to allow the test to clear an existing channel
state. This method may be of independent use in other areas in the
codebase in the future as well.
2019-03-08 19:15:10 -08:00
Olaoluwa Osuntokun
bc72691806
contractcourt: mark channel as borked before removing the link
In this commit, we ensure that we mark the channel as borked before we
remove the link during the force close process. This ensures that if the
peer reconnects right after we remove the link, then it won't be loaded
into memory in `loadActiveChannels`. We'll now:

  * mark the channel as borked
  * remove the link
  * read the channel state from disk
  * force close

This ensures that the link (if it's active) is able to commit any
pending changes to disk before we read out the channel to force close.
2019-03-08 19:15:08 -08:00
Olaoluwa Osuntokun
dac35c46f3
lnwallet: properly examine and check error from AppendRemoteCommitChain 2019-03-08 19:15:07 -08:00
Olaoluwa Osuntokun
49c38ed56d
lnwallet: update line wrapping to project style where needed 2019-03-08 19:15:06 -08:00
Olaoluwa Osuntokun
032eacb796
channeldb: prevent mutating on-disk commitment state if channel is borked 2019-03-08 19:15:04 -08:00
Olaoluwa Osuntokun
b409e5dfc4 lnwallet: add new TestForceCloseBorkedState test
In this commit, we add a new test: `TestForceCloseBorkedState`. This
ensures that it isn't possible to update the channel state once a
channel has been marked as borked. This assumes that all calls to
`ForceClose` will also mark the channel as borked. This isn't the case
yet, so this test fails as is.
2019-03-08 18:56:42 -08:00
Olaoluwa Osuntokun
3895a4f276
Merge pull request #2745 from cfromknecht/make-install-btcd
Makefile: actually install btcd w/ make btcd
2019-03-08 18:41:18 -08:00
Wilmer Paulino
9d443a9e12
Merge pull request #2746 from joostjager/sendpayment-arg
lncli: fix command line argument parsing for sendpayment
2019-03-08 11:54:21 -08:00
Joost Jager
5b6fdbeb6f
lncli: fix command line argument parsing for sendpayment
This commit fixes a bug that caused the payment hash to be (re)parsed as
an int representing the final cltv delta.
2019-03-08 10:42:18 +01:00
Conner Fromknecht
e0886ff1f5
Merge pull request #2739 from wpaulino/make-flake-unit-fix
Makefile: fix unit test flakehunter when running on specific package
2019-03-07 20:38:14 -08:00
Conner Fromknecht
29fe6e61e2
Makefile: actually install btcd w/ make btcd 2019-03-07 17:56:37 -08:00
Wilmer Paulino
b66f97c23a
Makefile: fix unit test flakehunter when running on specific package
When using the unit test flakehunter and specifying a package, after the
first successful run, all of the tests would be run, rather than just
the ones within the specified package.
2019-03-06 18:01:07 -08:00