Commit Graph

10808 Commits

Author SHA1 Message Date
Joost Jager
c325bf8c57
htlcswitch: sync link hand-off
This commit extends the link with a new synchronous delivery point for
local UpdateAddHTLC messages. The switch method SendHTLC is updated to
use this delivery point and thereby becomes a synchronous call.

For MPP payments, synchronous hand-off is important. Otherwise the next
pathfinding round could start without the channel balance updated yet.
2020-05-20 08:03:48 +02:00
Joost Jager
de2df5606a
htlcswitch: extract handleDownstreamUpdateAdd in link
To be able to call just the UpdateAdd logic for synchronously handled
local adds in a later commit.
2020-05-20 08:03:46 +02:00
Joost Jager
55930df70d
htlcswitch: update commit tx per downstream msg type
Unroll common code to allow splitting in separate handlers per message
type.
2020-05-20 08:03:44 +02:00
Joost Jager
b559811bf5
htlcswitch: extract updateCommitTxOrFail in link
Deduplicate code and prepare for further split of
handleDownstreamPkt.
2020-05-20 08:03:42 +02:00
Joost Jager
7afb43a012
htlcswitch: bypass main loop for local sends
There is no concurrent access in this code path, so there is no need to
pass the call through the main event loop.
2020-05-20 08:03:40 +02:00
Joost Jager
fe35d35458
htlcswitch: simplify local sends
Embed forward method into SendHTLC and remove redundant type check.
2020-05-20 08:03:38 +02:00
Joost Jager
babb0a36b4
switch/test: use external interface for testing
Previously the forward(...) method was used in forwarding tests,
while that code path isn't used for forwards in reality.
2020-05-20 08:03:36 +02:00
Conner Fromknecht
afc60353a1
Merge pull request #4213 from carlaKC/txdetails-addlabel
lnrpc: add optional labels to on chain transactions
2020-05-19 14:44:55 -07:00
carla
d021eae392
itest: add label check to sweep coins test
Add a label to our sweep all coins itest and check that it is correctly
set.
2020-05-19 13:31:51 +02:00
carla
e8ca306f12
lnrpc: display transaction label in transaction details 2020-05-19 13:31:51 +02:00
carla
52137459e4
lncli: add label flag to send many and send coins 2020-05-19 13:31:51 +02:00
carla
93a1b61218
walletrpc: add transaction label to PublishTransaction 2020-05-19 13:31:51 +02:00
carla
099161ed0b
multi: add label to WalletController SendOutputs and dependent rpcs
Add a label parameter to the WalletController SendOutputs endpoint and
update rpcs that use it to allow optional provision of labels.
2020-05-19 13:31:51 +02:00
carla
75370ce6b4
multi: update WalletController PublishTransaction to include label
Add label parameter to PublishTransaction in WalletController
interface. A labels package is added to store generic labels that are
used for the different types of transactions that are published by lnd.

To keep commit size down, the two endpoints that require a label
parameter be passed down have a todo added, which will be removed in
subsequent commits.
2020-05-19 13:30:00 +02:00
Olaoluwa Osuntokun
c2516d9352
Merge pull request #4286 from guggero/remove-global-cfg
multi: remove global cfg variable
2020-05-18 19:45:43 -07:00
Olaoluwa Osuntokun
34e21eca78
Merge pull request #4291 from wpaulino/btcd-getblock-compat
build: update to latest btcd and btcwallet versions
2020-05-18 18:25:01 -07:00
Wilmer Paulino
db2589ee8d
itest: add disconnection error to whitelist 2020-05-18 16:14:31 -07:00
Oliver Gugger
4d3bd6f178
Merge pull request #4295 from guggero/fix-queue
mod: update to queue/v1.0.4
2020-05-18 14:51:16 +02:00
Carla Kirk-Cohen
bdb6a3cc7b
Merge pull request #4294 from carlaKC/actions-updatecheckout
github: update checkout action to v2
2020-05-18 14:05:04 +02:00
Oliver Gugger
bd40f73be3
mod: update to queue/v1.0.4 2020-05-18 11:52:49 +02:00
carla
d29271f1da
github: update checkout action to v2
Checkout v1 has a known flake:
https://github.com/actions/checkout/issues/23#issuecomment-572688577.

For our linter to pass, we need to checkout our full history (default
depth is 1 commit). We could set fetch-depth, but we will eventually
move that depth past the linter's start point commit and need to
implement another fix. Indead, we add an extra step in our linter to
fetch full history so that the linter reference commit is found.
2020-05-18 11:39:09 +02:00
Wilmer Paulino
0e3fc4c7a6
build: update to latest btcd and btcwallet versions
This update introduces backwards compatibility for btcd nodes running
versions prior to v0.20.1-beta.
2020-05-15 17:00:16 -07:00
Olaoluwa Osuntokun
280bf8d26c
Merge pull request #4226 from breez/fix-chainrpc-crash
Fix crash when ChainNotifier is being accessed too early.
2020-05-15 16:17:40 -07:00
Olaoluwa Osuntokun
02f8a0db2b
Merge pull request #4277 from joostjager/fix-signer-err
lnwallet: return signer error
2020-05-15 16:15:50 -07:00
Olaoluwa Osuntokun
c6ae06242d
Merge pull request #4274 from wpaulino/wtclient-add-tower-filter
wtclient: load missing info into client sessions upon new tower
2020-05-15 16:13:22 -07:00
Wilmer Paulino
c760700545
wtmock: prevent race conditions by not using ClientSession pointers
These race conditions originate from the mock database storing and
returning pointers, rather than returning a copy.

Observed on Travis:

WARNING: DATA RACE
Read at 0x00c0003222b8 by goroutine 149:
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*sessionQueue).drainBackups()
      /home/runner/work/lnd/lnd/watchtower/wtclient/session_queue.go:288 +0xed
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*sessionQueue).sessionManager()
      /home/runner/work/lnd/lnd/watchtower/wtclient/session_queue.go:281 +0x450

Previous write at 0x00c0003222b8 by goroutine 93:
  github.com/lightningnetwork/lnd/watchtower/wtclient.getClientSessions()
      /home/runner/work/lnd/lnd/watchtower/wtclient/client.go:365 +0x24f
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*TowerClient).handleNewTower()
      /home/runner/work/lnd/lnd/watchtower/wtclient/client.go:1063 +0x23e
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*TowerClient).backupDispatcher()
      /home/runner/work/lnd/lnd/watchtower/wtclient/client.go:784 +0x10b9
2020-05-14 15:39:03 -07:00
Wilmer Paulino
f6f0d3819f
wtclient: test case re-add removed tower 2020-05-14 13:48:08 -07:00
Wilmer Paulino
b195d39ad7
rpc: use existing rpc logger for wtclientrpc
The logger string used to identify the wtclient and wtclientrpc loggers
was the same, leading to being unable to modify the log level of the
wtclient logger as it would be overwritten with the wtclientrpc's one.
To simplify things, we decide to use the existing RPC logger for
wtclientrpc.
2020-05-14 13:35:03 -07:00
Wilmer Paulino
ec5c941512
wtclient: filter out inactive sessions upon adding existing/new tower 2020-05-14 13:35:02 -07:00
Wilmer Paulino
75c2ebd794
wtclient: load missing info into client sessions upon new tower
This addresses a potential panic in where we relied on this missing info
being populated.
2020-05-14 13:35:00 -07:00
Wilmer Paulino
01ab551b22
wtclient: refactor existing candidate session filtering into method 2020-05-14 13:34:59 -07:00
Olaoluwa Osuntokun
8b09ac07d3
Merge pull request #4276 from guggero/actions-failure
github: remove continue-on-error
2020-05-14 11:58:23 -07:00
Oliver Gugger
4261d3f5af
lnd: remove global cfg variable 2020-05-14 16:18:02 +02:00
Oliver Gugger
50e86f88fe
rpcserver+subrpcserver: don't use global cfg 2020-05-14 16:18:02 +02:00
Oliver Gugger
7c1304b31c
peer: don't use global cfg 2020-05-14 16:18:02 +02:00
Oliver Gugger
4343f9e9a6
server+rpcserver: don't use global cfg 2020-05-14 16:18:01 +02:00
Oliver Gugger
7e4d0aba2f
lnd+rpcserver: don't use global cfg 2020-05-14 16:18:01 +02:00
Oliver Gugger
7ce70321ac
fundingmgr+server: don't use global cfg 2020-05-14 16:18:01 +02:00
Oliver Gugger
d44f205e3f
multi: move global networkDir to cfg 2020-05-14 14:47:35 +02:00
Oliver Gugger
85d5cdfbfd
multi: move global registeredChains to cfg 2020-05-14 14:47:35 +02:00
Oliver Gugger
a7e78112b7
multi: allow external subservers to register themselves
With two new callbacks we allow processes that use lnd as a library
to register additional gRPC and REST subservers to the main server
instances that lnd creates.
2020-05-14 14:47:33 +02:00
Oliver Gugger
620eaa3199
lnd+cmd: move interrupt into cmd
If the main package is used as a library, we don't want it to
register interrupt signals itself. Rather we want to pass in the
shutdown channel manually. We do this in the cmd now.
2020-05-14 14:37:51 +02:00
Oliver Gugger
7158103d4d
lnd+config: move config parsing to cmd
Now that we have access to the configuration parsing outside of the
main package, we can move the actual parsing to the command line
package.
2020-05-14 14:37:51 +02:00
Oliver Gugger
3b2188d689
multi: move exported items to lncfg 2020-05-14 14:37:51 +02:00
Oliver Gugger
25f8a0804d
config: fix comment and linter errors 2020-05-14 14:37:50 +02:00
Oliver Gugger
1f3a5ce0d4
config: export CleanAndExpandPath 2020-05-14 14:37:50 +02:00
Oliver Gugger
bc3909050e
multi: rename and export logWriter as RootLogWriter 2020-05-14 14:37:50 +02:00
Oliver Gugger
a56ca0d0cf
config: export default values for config file
Variables related to the default configuration file location are
needed if the config parsing is happening externally. We export them
so they don't need to be copied to projects that use lnd as a library.
2020-05-14 14:37:49 +02:00
Oliver Gugger
aba29df84d
config: extract config validation
To allow external configuration parsing and validation, this commit
exports the function that checks a configuration for sanity.
Also because we touch the code, we need to fix all linter errors.
2020-05-14 14:37:49 +02:00
Oliver Gugger
d4d10b5c71
config: extract default config into function
To make it easy to extract the configuration parsing out of the main
package, the default config is exported as its own function.
2020-05-14 14:37:49 +02:00