Commit Graph

668 Commits

Author SHA1 Message Date
carla
887ff442db
multi: fix verbose output for listsweeps and check all against wallet
Previously, the verbose output of listsweeps would fail if we did not
find some sweeps in our wallet's listtransactions output. This could be
the case for sweeps that were rbf-ed, so the endpoint would fail. This
commit also updates the listsweeps endpoint to always check against the
wallet, so that we do not return these discarded sweeps that never
confirmed.
2020-11-13 13:59:52 +02:00
Olaoluwa Osuntokun
99b0913562
Merge pull request #3672 from breez/invoice-hints
Allow user specify routing hints in private invoice.
2020-11-11 19:57:49 -08:00
Olaoluwa Osuntokun
c2bba7ed71
Merge pull request #4691 from joostjager/sendtoroute-status-code
routerrpc: map errors to grpc status code
2020-11-11 19:51:45 -08:00
carla
5679dde1bc
multi: add channel open parameters to channel acceptor
Add more fields to channel acceptor response so that users can have more
fine grained control over their incoming channels. With our chained
acceptor, it is possible that we get inconsistent responses from
multiple chained acceptors. We create a conjugate repsponse from all the
set fields in our various responses, but fail if we get different, non-
zero responses from our various acceptors. Separate merge functions are
used per type so that we avoid unexpected outcomes comparing interfaces
(panic on comparing types that aren't comparable), with casting used
where applicable to avoid code duplication.
2020-11-10 21:09:10 +02:00
carla
38fd7d206f
multi: add custom error messages to channel acceptor
This commit adds an optional error message to the channel acceptor's
reponse to allow operators to inform (or insult) unsuccessful channel
initiators as to the reason for their rejection.

This field is added in addition to the existing accept field to maintain
backwards compatibity. If we were to deprecate accept and interpret a
non-nil error as rejecting the channel, then received a response with
accept=false and a nil error, the server cannot tell whether this is a
legacy rejection or new mesage type acceptance (due to nil error),
so we keep both fields.
2020-11-10 11:38:47 +02:00
Graham Krizek
5aa0d26251
lnrpc+macaroon: skip subserver macaroons on stateless_init
This will prevent the subservers from writing macaroons to disk
when the stateless_init flag is set to true. It accomplishes
this by storing the StatelessInit value in the Macaroon Service.
2020-11-07 11:24:35 +01:00
Oliver Gugger
4c8d374007
lnrpc: add arguments for stateless wallet initialization to wallet unlocker
This commit adds the --stateless_init flag to all three wallet unlocker
operations. Once you initialize a wallet stateless, you need to set
this flag for every further wallet unlocker operation. Otherwise you
risk non-encrypted macaroon information to leak to the underlying
system.
2020-11-07 11:18:52 +01:00
Roei Erez
4463a4ce17 invoicerpc: Allow user specify routing hints. 2020-11-06 17:54:20 +02:00
Andras Banki-Horvath
e8f47cf882
invoices: channel graph reference was wrongly retrieved from remote db
This commit fixes a bug where we tried to use the graph from the remote
db instance whereas it lives in the local db instance.
2020-11-05 17:57:13 +01:00
carla
91bf59df17
multi: allow specifying max csv for locally initiated channels 2020-11-04 13:55:39 +02:00
Olaoluwa Osuntokun
21b9f24d28
Merge pull request #4675 from champo/sphinx_interceptor
htlcswitch,rpc: expose onion blob for intercepts
2020-11-03 17:30:21 -08:00
Juan Pablo Civile
033c5b7a3f htlcswitch,rpc: expose onion blob for intercepts 2020-10-31 14:09:52 -03:00
Conner Fromknecht
4adb8123af
Merge pull request #4693 from joostjager/listchannels-circuits
lnrpc: expose linked htlcs in ListChannels
2020-10-29 12:52:34 -07:00
yyforyongyu
2cb42594a9
trivial: fix make rpc-format 2020-10-25 18:51:42 +08:00
Joost Jager
49df2d6f8b
lnrpc: expose forwarding channel for htlcs in ListChannels 2020-10-16 09:03:24 +02:00
Joost Jager
d13b813dbb
lnrpc: add htlc index to ListChannels pending htlcs 2020-10-14 17:44:22 +02:00
Joost Jager
856abade3d
routerrpc: map errors to grpc status code
The 'payment already exists' case is common in restart scenarios. With
this commit it is no longer necessary to string-match on the error
message. Implementation is identical to SendPaymentV2.
2020-10-14 16:15:08 +02:00
Oliver Gugger
843efc324b
walletrpc: serialize TXID not outpoint
The txid_str field of a locked UTXO's outpoint shouldn't contain the
output index but only the reverse order hex serialized transaction ID.
2020-10-06 10:59:51 +02:00
Oliver Gugger
9a063355e2
walletrpc: disallow locking with internal ID
The internal lock ID that the wallet kit subserver uses to lock inputs
for itself shouldn't be allowed to be used when locking inputs manually
over the RPC.
2020-10-03 10:34:55 +02:00
Oliver Gugger
6229609be7
lnrpc+walletrpc: add RPCs for new PSBT methods 2020-10-03 10:34:53 +02:00
Tom Kirkpatrick
73a5f325b6
lnrpc: ability to spend unconfirmed coins 2020-10-01 13:27:03 +01:00
yyforyongyu
f8c1bee637
lnrpc+rpcserver: verbose result in ChannelBalance 2020-09-24 20:26:08 +08:00
yyforyongyu
1c80f9818f
signrpc: SharedKeyRequest accept raw pubkey 2020-09-17 10:14:54 +08:00
Wilmer Paulino
a5c5304c09
Merge pull request #4452 from yyforyongyu/add-connection-timeout
lnrpc+tor: add network connection timeout
2020-09-16 12:28:29 -07:00
Joost Jager
3531c3fbbe
Merge pull request #4602 from joostjager/proportional-attempt-cost
routing: proportional attempt cost
2020-09-16 14:12:19 +02:00
yyforyongyu
469aba9282
lnd+rpcserver: allow customized timeout in ConnectPeer 2020-09-16 11:50:04 +08:00
Oliver Gugger
c4ada8a592
lnrpc: add final raw TX to PSBT finalize 2020-09-15 08:30:21 +02:00
Joost Jager
bbfeeec8b1
routing: add proportional attempt cost 2020-09-08 15:47:08 +02:00
carla
e2c0604657
multi: add flap count and last flap time to listpeers 2020-09-08 15:01:06 +02:00
Joost Jager
17a6175e8b
routing+routerrpc: rename PaymentAttemptPenalty to AttemptCost
Make field names consistent with the command line flag.
2020-09-08 14:07:56 +02:00
Oliver Gugger
d33f87493e
routerrpc: pass in probability source 2020-09-04 16:39:52 +02:00
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