Commit Graph

8829 Commits

Author SHA1 Message Date
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
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
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
carla
ec099bf5dd
htlcswitch: remove extramsg string from ForwardingError
Remove the extramsg field in ForwardingError because
it has been replaced with detailed link errors.
2020-01-14 15:23:11 +02:00
carla
f430fd50c5
htlcswitch: use LinkError for internal errors
Update the ChannelLink interface to specifically
return the LinkError struct. This error implements
the ClearTextError interface, so will be picked
up as a routing realted error by the router.

With LinkErrors implemented, the switch now
returns a LinkError for all failures on our
incoming/outgoing link and ForwardingError when
the failure occurs down the line.
2020-01-14 15:21:15 +02:00
carla
b5a2d75465
htlcswitch+routing: type check on ClearTextError
Update the type check used for checking local payment
failures to check on the ClearTextError interface rather
than on the ForwardingError type. This change prepares
for splitting payment errors up into Link and Forwarding
errors.
2020-01-14 15:07:42 +02:00
carla
6a83b06ab7
htlcswitch: add LinkError implementation of ClearTextError
This change introduces a LinkError implementation
of the ClearTextError interface. This error is intended
to represent failures which occur on our incoming and
outgoing link when sending, receiving and forwarding
htlcs. Paired with ForwardingError, which is represents
failures that did not occur at our node, this error
covers all non-opaque errors that the switch experiences.
2020-01-14 15:07:41 +02:00
carla
102f9b003f
htlcswitch: add ClearTextError interface
This commit adds a ClearTextError interface
which is implemented by non-opaque errors that
we know the underlying wire failure message for.
This interface is implemented by ForwardingErrors,
because we can fully decrypt the onion blob to
obtain the underlying failure reason. This interface
will also be implemented by errors which originate
at our node in following commits, because we know
the failure reason when we fail the htlc.

The lnwire interface is un-embedded in the
ForwardingError struct in favour of implementing
this interface. This change is made to protect
against accidental passing of a ForwardingError
to the wire, where the embedded FailureMessage
interface will present as wire failure but
will not serialize properly.
2020-01-14 15:07:41 +02:00
carla
6f0a342f92
htlcswitch: add ForwardingError constructor
Add a constructor for the creation of forwarding errors.
A special constructor is added for the case where we have
an unknown wire failure, and must set a nil failure message.
2020-01-14 15:07:29 +02:00
Joost Jager
d978b55701
lncli: add custom data payment flag 2020-01-14 13:01:45 +01:00
Joost Jager
81bf6e15b3
routing+lnrpc: add missing query routes parameters 2020-01-14 11:21:31 +01:00
Joost Jager
9c577f3f57
routing: extract route hint conversion 2020-01-14 11:21:29 +01:00
Johan T. Halseth
daa08be62a
Merge pull request #3907 from halseth/mobile-walletunlocker-tls
[mobile] Set walletunlocker TLS credentials
2020-01-14 10:30:02 +01:00
Johan T. Halseth
56230f5de2
mobile: add note about using lnddir
On both Android and iOS (when not using a simulator) the application
procees doesn't have write permissions to the default lnd directory.
This commit adds a note about using the app directory given by the used
platform.
2020-01-14 09:30:09 +01:00
Johan T. Halseth
f5a9813304
mobile: add TLS options to wallet unlocker listener
The wallet unlocker service also requires the TLS certificates to be
added, but this was not set. This commit sets the options similar to
what is done for the regular RPC server.
2020-01-14 09:30:09 +01:00
Johan T. Halseth
a870ed5fb7
lnd: add WalletUnlockerAuthOptions
Similar to what was done for the regular RPC server, we add auth dial
options for the wallet unlocker, as it also requires TLS now.
2020-01-14 09:30:09 +01:00
Olaoluwa Osuntokun
a0639c234f
Merge pull request #3887 from bhandras/channeldb_cleanup
channeldb: remove FetchAllInvoices which was test only and unused
2020-01-13 23:16:58 -08:00
Olaoluwa Osuntokun
ec70347b8d
Merge pull request #3897 from cfromknecht/cleanup-pathfind-tests
routing/pathfind_test: use ctx in recent tests
2020-01-13 22:13:10 -08:00
Olaoluwa Osuntokun
91e796aed8
Merge pull request #3903 from joostjager/keysend-no-spam
invoices: streamline key send cltv delta picking and validation
2020-01-13 22:12:25 -08:00
Bastien Teinturier
17200afc57
lnwire: explicitly handle empty list when encoding short chan IDs
Before this commit, both writing and reading an encoded empty set of
short channel IDs from the wire would fail. Prior to this commit, we
treated decoding an empty set as a caller error, and failed to write out
the zlib encoding of an empty set in a way that us and the other
implementations were able to read.

To fix this, rather than giving zlib an empty buffer to write out (which
results in an encoding with the zlib header data and the rest), we just
write a blank slice. When decoding, if we have an empty query body, then
we'll return a `nil` slice.

With the above changes, we'll now always write out an empty short
channel ID set as:
```
0001 (1 byte follows) || <encoding_type>
```

A new test has also been added to exercise this case for both known
encoding types.
2020-01-13 20:26:55 -08:00
Johan T. Halseth
dae5dddfd2
mobile: trim arg spaces before comparison
Since spaces where trimmed only after checking for empty strings, an
empty flag '-- ' would be passed along to lnd. Intead we trim first to
properly ingore such flags.
2020-01-13 13:25:14 +01:00
Olaoluwa Osuntokun
83ff6a59d4
Merge pull request #3899 from cfromknecht/improve-last-hop-help
lncli: improve last_hop help message
2020-01-10 14:49:06 -08:00
Joost Jager
d3fa9767a9
rpc: use more sensible final cltv delta default when sending payments 2020-01-10 21:35:34 +01:00
Joost Jager
59a7a9d308
invoices: pre-check key send expiry 2020-01-10 21:35:14 +01:00
Oliver Gugger
0ce2d6f523
Merge pull request #2699 from yancyribbens/docker-compose-up
docker-compose up
2020-01-10 09:56:21 +01:00
Conner Fromknecht
b3f2a94c3b
lncli: improve last_hop help message
Clarifies that last_hop is not the destination, but the penultimate node
in the path, i.e. the last intermediary.
2020-01-09 17:57:52 -08:00
Conner Fromknecht
32284ef1f1
routing/pathfind_test: use ctx in recent tests
Modifies TestMissingFeatureDep and TestDestPaymentAddr to use the test
ctx directly instead of generating a closure and using local state to
modify restrictions.
2020-01-09 13:53:45 -08:00