Commit Graph

9905 Commits

Author SHA1 Message Date
Johan T. Halseth
1dadce7cfd
Merge pull request #3945 from joostjager/node-level-penalty
routing: penalize node-level failures harder
2020-01-25 12:50:09 +01:00
Olaoluwa Osuntokun
e79897e651
Merge pull request #3950 from bhandras/invoice-expiry-startup-fix
invoices: fix slow startup with many expired invoices
2020-01-24 16:49:43 -08:00
Olaoluwa Osuntokun
767128e6c5
Merge pull request #3927 from guggero/lnwallet-scrypt
keychain+walletunlocker: use fast scrypt options for unit tests
2020-01-24 13:24:30 -08:00
Andras Banki-Horvath
fabcdf754a invoices: fix slow startup with many expired invoices
This commit intends to fix slow first startup time when there are many
invoices that need to be canceled. The slowdown is caused by a combination
of adding invoices to the expiry watcher one-by-one and slow
cancellation. Due to slow cancellation and the unbuffered channel which
we use to pass invoices to the expiry watcher blocks the registry.
With this fix we'll instead batch add invoices to the expiry watcher and
thereby won't block the registry startup.
2020-01-24 21:01:10 +01:00
Johan T. Halseth
a8ec8f2db6
Merge pull request #3582 from hsjoberg/pendingchannelevent
rpc: Add PendingOpenChannel to SubscribeChannelEvents
2020-01-24 14:42:40 +01:00
Oliver Gugger
3f45fb3781
walletunlocker: use fast scrypt options for unit tests 2020-01-24 14:02:40 +01:00
Oliver Gugger
29ece5fe24
keychain: use fast scrypt options for unit tests 2020-01-24 14:02:40 +01:00
Oliver Gugger
1cb52491a3
mod: update btcwallet dependency 2020-01-24 14:02:39 +01:00
Hampus Sjöberg
227e66c469 rpc: Add PendingOpenChannel to SubscribeChannelEvents
This commit adds PendingOpenChannel to SubscribeChannelEvents stream in
the gRPC API.
This is useful for keeping track of channel openings that Autopilot does.
It can also be used for the non-initator side of a channel opening to keep
track of channel openings.
2020-01-24 13:48:18 +01:00
Olaoluwa Osuntokun
51d8c11eb5
Merge pull request #3925 from wpaulino/query-chan-range-wrong-chainhash
discovery: check ChainHash in QueryChannelRange messages
2020-01-23 12:10:56 -08:00
Joost Jager
1413995ab7
Merge pull request #3872 from joostjager/invalid-sig-fix
htlcswitch+lnwallet+channeldb: invalid sig fix
2020-01-23 21:08:07 +01:00
Joost Jager
b573a5e61a
Merge pull request #3797 from joostjager/explicit-now-dependency-channeldb
channeldb: inject clock into database
2020-01-23 14:27:02 +01:00
Johan T. Halseth
fd75f29480
Merge pull request #3908 from halseth/mobile-trim-spaces
[mobile] trim arg spaces before comparison
2020-01-23 11:54:25 +01:00
Johan T. Halseth
bebb6395ec
Merge pull request #2137 from halseth/payintent-recv-eof
rpcserver: fix error handling in bidirectional sendPayment
2020-01-23 11:53:56 +01:00
Joost Jager
1851dfdcf7
Merge pull request #3947 from joostjager/missing-result-strings
invoices: add missing String() cases
2020-01-23 11:47:06 +01:00
Joost Jager
ae9c6faebf
Merge pull request #3809 from joostjager/anchor-sweeper
sweep: allow force sweeping of negatively yielding inputs
2020-01-23 11:46:46 +01:00
Olaoluwa Osuntokun
f8418ab705
Merge pull request #3949 from Roasbeef/fix-release-script-tags
build/release: update release script to handle multiple tags at head
2020-01-21 23:29:48 -08:00
Olaoluwa Osuntokun
8b086bb581
build/release: update release script to handle multiple tags at head
In this commit, we change the release script slightly to return the
latest tag if there're multiple tags at head. Otherwise the release
script will fail if our final tag is at the same commit as the prior
release candidate tag.
2020-01-21 20:46:40 -08:00
Olaoluwa Osuntokun
a2977c4438
Merge pull request #3948 from halseth/falafel-0.7
mobile: bump falafel dep to 0.7
2020-01-21 13:33:02 -08:00
Johan T. Halseth
2b6575463b
mobile: bump falafel dep to 0.7 2020-01-21 20:45:58 +01:00
Joost Jager
c7208ffb2c
invoices: add missing String() cases 2020-01-21 16:52:13 +01:00
Johan T. Halseth
dc23810118
rpcServer: wait for all goroutines to finish before exiting
Returning from the sendPayments method closes the underlying stream, so
we would risk payments still being in flight when returning.

We add the running goroutines to a waitgroup, such that we can wait for
them all to exit before exiting and closing the stream.

In case an error is encountered in the process, we will return directly,
which will close the `reqQuit` channel and prompt the gorpoutines to
shut down.
2020-01-21 12:45:12 +01:00
Johan T. Halseth
5b85721c04
rpcServer: ensure all payIntents are handled before exiting
This commit fixes a problem that could arise when handling a continuous
stream of payIntents. We would risk the client sending a set of payment
intents and closing the stream, but we wouldn't be sure the sendLoop had
read all messages on the `payChan` before exiting with the nil error
from the `errChan`.

Instead, we close the `payChan` to indicate that no more payments are
going to be received.
2020-01-21 12:45:12 +01:00
Johan T. Halseth
c49ba0c5cb
rpcServer: ensure we don't get blocked on bidirectional payment errors
This commit fixes a potential issue in the bidirectional sendPayment
case, where multiple goroutines could be sending on an errChan with
buffer 1. Instead we select on default as well, as it is enough to
handle the first error that was received.
2020-01-21 12:45:12 +01:00
Johan T. Halseth
f20f29696a
rpcserver: let sendPayment sendLoop listen for shutdown
Intead of checking for shutdown in the receive loop, we let the sendLoop
handle it, as it can return the error directly. This works since the
returning sendLoop will trigger a close of the `reqQuit` channel, which
will ensure the receive loop exits.
2020-01-21 12:28:31 +01:00
Joost Jager
ef28d2aaed
routing: penalize node-level failures harder
Previously we only penalized the outgoing connections of a failing node.
This turned out not to be sufficient, because the next route sometimes
went into the same failing node again to try a different outgoing
connection that wasn't yet known to mission control and therefore not
penalized before.
2020-01-21 09:06:42 +01:00
Johan T. Halseth
80ad0fdd5c
lntest: restart Alice after on-chain settle
To ensure lnd is able to pick up an on-chain preimage properly after a
restart, we suspend Alice and check that the payment is listed correctly
as succeeded after a restart.
2020-01-20 14:01:19 +01:00
Johan T. Halseth
bb619352be
lntest: check payment status settled after claim test 2020-01-20 13:55:13 +01:00
Joost Jager
b600ecda86
channeldb: inject clock into database
Use our standard clock mock for database time queries.
2020-01-20 11:08:30 +01:00
Carsten Otto
a908a74acb Fix typos 2020-01-17 21:18:20 +00:00
Wilmer Paulino
57b69e3b1a
discovery: check ChainHash in QueryChannelRange messages
If the provided ChainHash in a QueryChannelRange message does not match
that of our current chain, then we should send a blank response, rather
than reply with channels for the wrong chain.
2020-01-17 11:51:09 -08:00
Olaoluwa Osuntokun
ad0a89b844
Merge pull request #3922 from cfromknecht/keysend
multi: rename key_send, key-send and key send to keysend
2020-01-17 11:26:13 -08:00
Conner Fromknecht
51dbdd3b38
multi: rename key_send, key-send and key send to keysend 2020-01-16 18:37:16 -08:00
Joost Jager
3aba0f1eaf
Merge pull request #3918 from joostjager/fix-qr-hints
routing: remove path finding shortcut
2020-01-15 23:06:05 +01:00
Joost Jager
e9b7e80848
routing: remove path finding shortcut
This shortcut does not work when the destination is a private node. We
also don't have this shortcut for regular payments. This commit
aligns the behavior between SendPayment and QueryRoutes.
2020-01-15 20:32:45 +01:00
Joost Jager
b0aae13d70
sweep: allow force sweeps 2020-01-15 16:56:44 +01:00
Joost Jager
14237f5fd4
sweep: create add constraints
This refactor prepares for the addition of specific constraints for
force sweep inputs.
2020-01-15 16:56:42 +01:00
Joost Jager
16832cefa3
sweep: allow updating all sweep parameters
This is a preparation for adding additional parameters besides the fee
preference.
2020-01-15 16:56:40 +01:00
Joost Jager
27139b8c28
Merge pull request #3917 from cfromknecht/send-coin-bech32
lncli: fix sendcoins docs, allow base58 or bech32 addrs
2020-01-15 16:19:14 +01:00
Conner Fromknecht
51306f4ecd
lncli: fix sendcoins docs, allow base58 or bech32 addrs 2020-01-15 05:01:42 -08:00
Joost Jager
82579400b3
lnwallet: restore unsigned acked remote updates
This commit updates the channel state machine to
persistently store remote updates that we have received a
signature for, but that we haven't yet included in a commit
signature of our own.

Previously those updates were only stored in memory and
dropped across restarts. This lead to the production of
an invalid signature and channel force closure. The remote
party expects us to include those updates.
2020-01-15 13:09:35 +01:00
chokoboko
0b9940a398 Remove duplicated address permission entity 2020-01-15 14:03:44 +02:00
Joost Jager
ed8fa35ed4
lnwallet: extract pending local updates restore method
Extract method in preparation for restoring dangling remote updates. We
need to get rid of the early return.
2020-01-15 12:37:26 +01:00
Joost Jager
2d37d341a1
channeldb: extract log update serialization
Extract functionality to methods as a preparation for serializing remote
log updates.
2020-01-15 12:37:24 +01:00
Joost Jager
ea892fce17
channeldb: update UpdateCommitment description
This method is only used to update the local commitment transaction.
Updated comment accordingly.
2020-01-15 12:37:22 +01:00
Joost Jager
6a866890a8
lnwallet/test: test remote update after restart
This test asserts that remote updates that are locked-in on the local
commitment, but haven't been signed for on the remote commitment, are
properly restored after a restart.
2020-01-15 12:37:20 +01:00
Carla Kirk-Cohen
7d356458e3
Merge pull request #3843 from carlaKC/htlcnotifier-0-switcherrors
[htlcnotifier 1/4]: Introduce Internal Errors
2020-01-15 08:46:38 +02:00
Olaoluwa Osuntokun
269182c9b9
Merge pull request #3911 from joostjager/extend-qr
routing+lnrpc: add missing query routes parameters
2020-01-14 16:07:45 -08:00
Olaoluwa Osuntokun
3799f1689b
Merge pull request #3900 from joostjager/payment-msg
lnrpc+lncli: add send support for custom data records
2020-01-14 15:53:10 -08:00
Joost Jager
5de308c4b5
routerrpc: update final cltv delta default
The default was increased for the main sendpayment RPC in commit
d3fa9767a9729756bab9b4a1121344b265410b1a. This commit sets the
same default for QueryRoutes, routerrpc.SendPayment and
router.EstimateRouteFee.
2020-01-14 21:03:24 +01:00