Commit Graph

637 Commits

Author SHA1 Message Date
Oliver Gugger
4996b28dab
lnrpc+lncli: add command to print macaroon 2020-09-04 09:50:42 +02:00
Oliver Gugger
ba6156d41d
lnrpc+rpcserver: add ListPermissions RPC
As a convenience method for users to look up what RPC method URIs exist
and what permissions they require, we add a new ListPermissions call
that simply returns all registered URIs (including internal and external
subservers) and their required permissions.
2020-09-04 09:50:38 +02:00
Oliver Gugger
3caca4fa3f
lnrpc+rpcserver: enable abandonchannel for externally funded chans
To make sure we can use the abandonchannel RPC for getting rid of
externally funded channels who's funding transaction was never
published, we allow the RPC to be used on non-dev builds for externally
funded and pending channels only.
2020-08-28 12:28:58 +02:00
Conner Fromknecht
9e73683c45
lnrpc: add remote_max_htlcs to OpenChannelRequest
This will allow users to set a custom limit for the max number of
concurrent HTLCs the remote party can add to the channel.
2020-08-24 20:11:33 -07:00
Olaoluwa Osuntokun
bd18f9acf5
Merge pull request #4427 from yyforyongyu/customize-root-key-id
macaroons: customize root key ID
2020-08-21 19:34:15 -07:00
yyforyongyu
c8a2916d91
lncli: support list/delete on marcaroon IDs 2020-08-14 12:36:21 +08:00
yyforyongyu
c0e2513350
lnrpc+rpcserver: support list/delete on marcaroon IDs 2020-08-14 12:33:13 +08:00
Olaoluwa Osuntokun
174faa7955
lnrpc/invoicesrpc: only try to add hop hints if we have channels 2020-08-13 14:47:27 -07:00
Olaoluwa Osuntokun
f6d6d6609f
lnrpc/invoicesrpc: extend hop hint selection to account for MPP
In this commit, we update the hop hint selection to account for the fact
that with MPP, a single payment may consume multiple channels. As is, if
a user only has two 0.5 BTC channels, and tries to make a 1 BTC channel,
then the current logic won't include any hop hints.

To solve this, we first add all the channels which in isolation can
carry the payment in question. We then do another pass that accumulates
channels until either we reach our hop-hint limit, or the total
bandwidth that we've accumulate is greater than 2x the payment amount.
2020-08-13 14:47:25 -07:00
Olaoluwa Osuntokun
f42d7780f1
lnrpc/invoicesrpc: refactor out hop hint accumulation into a new function 2020-08-13 14:47:24 -07:00
Olaoluwa Osuntokun
ab055efa56
lnrpc/invoicesrpc: move hop hint eligibility for chan to new method 2020-08-13 14:47:23 -07:00
Olaoluwa Osuntokun
7a83731edb
lnrpc/invoicesrpc: move hop hint selection into new method 2020-08-13 14:47:22 -07:00
Oliver Gugger
c5c28564e9
lnrpc: add macaroon workaround for WebSockets in browsers
For security reasons, browsers are limited in the header fields they can
send when opening a WebSocket connection. Specifically, the macaroon
cannot be sent in the Grpc-Metadata-Macaroon header field as that would
be possible for normal REST requests. Instead we only have the special
field "Sec-Websocket-Protocol" that can be used to transport custom
data. We allow the macaroon to be sent there and transform it into a
proper header field for the target request.
2020-08-06 12:07:07 +02:00
Candle
adfd0dc015
rpc: add missing space to error message
This corrects the output of the chain notifier RPC error. It has been displayed as: "chain notifier RPC *isstill* in the process of starting"
2020-08-05 09:58:05 +00:00
Conner Fromknecht
6622c4814e
multi: enforce routing.MinCLTVDelta=18 for invoices + chanupd
This commit clamps all user-chosen CLTVs in LND to be at least 18, which
is the new conservative value used in the sepc. This minimum is applied
uniformly to forwarding CLTV deltas (via channel updates) as well as
final CLTV deltas for new invoices.
2020-07-24 13:13:56 -07:00
Olaoluwa Osuntokun
14a047ffba
Merge pull request #4455 from cfromknecht/psbt-no-publish
PSBT: add no_publish flag for safe batch channel opens v2
2020-07-20 12:04:10 -07:00
Olaoluwa Osuntokun
26cff10c19
Merge pull request #4344 from matheusdtech/lntest-improvs
lntest+itest improvements
2020-07-15 18:01:33 -07:00
yyforyongyu
9fa81af2a8 trivial: fix make rpc-format 2020-07-14 18:30:46 +08:00
Matheus Degiovani
0e73d2d243 itest: assert unspent before performing CPFP
This reduces the flakiness of the CPFP test by asserting the wallet has
seen the unspent output before attempting to perform the walletkit's
BumpFee method.

Previously the attempt to bump the fee of the target transaction could
be made before the wallet had had a chance to fully process the
transaction, causing a flaky error.
2020-07-13 13:24:22 -03:00
Oliver Gugger
3a818b9735
lnrpc: add no_publish flag to PSBT shim 2020-07-08 17:12:41 -07:00
carla
1d5d616da3
lnrpc: add channel resolutions to closed channels 2020-07-07 19:50:12 +02:00
Wilmer Paulino
9e8c39d4a2
Merge pull request #971 from vctt94/addMaxValueFlag
Add max value in flight flag
2020-07-07 10:29:51 -07:00
Wilmer Paulino
6075997ebc
multi: add relative thaw height interpretation
This is useful when we wish to have a channel frozen for a specific
amount of blocks after its confirmation. This could also be done with an
absolute thaw height, but it does not suit cases where a strict block
delta needs to be enforced, as it's not possible to know for certain
when a channel will be included in the chain. To work around this, we
add a relative interpretation of the field, where if its value is below
500,000, then it's interpreted as a relative height. This approach
allows us to prevent further database modifications to account for a
relative thaw height.
2020-07-02 12:05:49 -07:00
vctt94
8ebdfe3128 lnrpc: Add MaxValueInFlight flag 2020-07-02 15:50:26 -03:00
yyforyongyu
f11da830b9 lnrpc: expose all local and remote channel constraints 2020-06-30 06:59:18 +08:00
Joost Jager
2903505164
htlcswitch: expose custom records on intercepted packet 2020-06-27 11:00:46 +02:00
Joost Jager
363142de33
htlcswitch: expose additional fields for intercepted packets 2020-06-27 11:00:44 +02:00
Joost Jager
74db43282c
htlcswitch: encapsulate exposed packet info 2020-06-27 10:59:08 +02:00
Joost Jager
607927634d
routerrpc: remove redundant htlc prefix from proto field
The message name already sets the context to an htlc.
2020-06-27 10:59:06 +02:00
Joost Jager
f6f8e3221b
routerrpc: clarify proto fields to be outgoing 2020-06-27 10:59:04 +02:00
yyforyongyu
987edc9d81 multi: add a rpc endpoint to track the recovery process 2020-06-25 15:49:54 +08:00
Roei Erez
7b56268f70 rpc: implement RPC htlc interceptor.
In this commit we add the ability to intercept forwarded htlc packets
straight from the RPC layer. The RPC layer handles a bidrectional stream
that comminucates to the client the intercepted packets and handles its
response by coordinating with the interceptable switch.
2020-06-18 15:20:07 +03:00
Oliver Gugger
1cda467701
lnrpc: explain how to use map types in REST 2020-06-17 08:35:52 +02:00
Oliver Gugger
6250ed1cf1
lnrpc: add WebSocket proxy 2020-06-17 08:34:54 +02:00
Wilmer Paulino
c2f1fe26c1
rpc: acquire global coin select lock in related RPCs
This ensures proper coin selection synchronization between lnd and users
of the RPC to avoid potential double spend errors.
2020-06-12 11:22:29 -07:00
Wilmer Paulino
98da6c61c1
signrpc: parse both KeyDescriptor fields for SignOutputRaw requests
This is meant to handle a quirk in which key descriptors obtained
through walletrpc.DeriveKey don't result in the derived key being
persisted to the wallet's database, unlike with DeriveNextKey. Due to
this and some fallback logic in the wallet with regards to empty key
locators, if a request only specified the compressed public key, the
signature returned would be over a different key, namely the one derived
from (family=0, index=0).
2020-06-04 17:44:25 -07:00
Oliver Gugger
19e3dc6378
routerrpc: format proto 2020-06-04 08:50:44 +02:00
Oliver Gugger
558d63718b
rpcserver+lnrpc: register REST subservers with root server 2020-06-04 08:50:44 +02:00
Oliver Gugger
fe16be5bb8
lnrpc: extract or add REST annotations to yaml 2020-06-04 08:50:00 +02:00
Oliver Gugger
3ef41dd198
lnrpc: update grpc-gateway to v1.14.3 2020-06-04 08:43:49 +02:00
Wilmer Paulino
146611d1c1
lnrpc: mark existing ListUnspent RPC as deprecated in favor of walletrpc 2020-06-03 19:03:05 -07:00
Wilmer Paulino
acfd432602
walletrpc: add ListUnspent RPC 2020-06-03 19:03:04 -07:00
Wilmer Paulino
7616a3dc7f
rpc: refactor request validation and response marshal into functions 2020-06-03 18:50:11 -07:00
Wilmer Paulino
9dcaf4fbc6
walletrpc: add output leases RPCs 2020-06-03 18:50:09 -07:00
Joost Jager
d416ed59ea
multi: add explicit hodl invoice flag to invoice
Previously it wasn't possible to store a preimage in the invoice
database and signal that a payment should not be settled right away. The
only way to hold a payment was to insert the magic UnknownPreimage value
in the invoice database. This commit introduces a distinct flag to
signal that an invoice is a hold invoice and thereby allows the preimage
to be present in the database already.

Preparation for (key send) hodl invoices for which we already know the
preimage.
2020-06-02 07:34:23 +02:00
Joost Jager
df7a05da84
rpcserver+routerrpc: remove payment limit 2020-05-28 19:34:17 +02:00
carla
97a843f3cd
walletrpc: add LabelTransaction rpc 2020-05-25 11:33:33 +02:00
Oliver Gugger
08d6a61e2a
signrpc: use DigestSigner interface for signing 2020-05-20 09:06:59 +02:00
Oliver Gugger
4003f25281
signrpc: use ECDH interface for shared key generation 2020-05-20 09:06:58 +02:00
carla
e8ca306f12
lnrpc: display transaction label in transaction details 2020-05-19 13:31:51 +02:00