Commit Graph

797 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
67b8bca5b2
rpc: allow outgoing wumbo channel requests if wumbo is enabled 2020-07-10 16:27:16 -07:00
Oliver Gugger
258996233f
lnwallet+rpcserver: add no_publish flag to PSBT assembler 2020-07-08 17:12:57 -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
nsa
cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
nsa
9be9d69349 multi: initialize peer with peer.Config 2020-07-06 19:16:07 -04:00
nsa
0dda9e06ce multi: exporting PendingUpdate, ChannelCloseUpdate, ErrorBufferSize 2020-07-06 19:16:06 -04:00
vctt94
2f6a8b13ae fundingmanager: Add max value to fundingmanager and fundingmanager_test 2020-07-03 11:09:40 -03: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
474ce4ae25 server: Add max value in flight to server 2020-07-02 15:49:19 -03:00
yyforyongyu
f11da830b9 lnrpc: expose all local and remote channel constraints 2020-06-30 06:59:18 +08: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
Anthony Ronning
a76e752f3b
config+lnd+rpcserver: add CORS origin config for REST 2020-06-17 08:34:55 +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
Oliver Gugger
558d63718b
rpcserver+lnrpc: register REST subservers with root server 2020-06-04 08:50:44 +02:00
Wilmer Paulino
7616a3dc7f
rpc: refactor request validation and response marshal into functions 2020-06-03 18:50:11 -07:00
Joost Jager
df7a05da84
rpcserver+routerrpc: remove payment limit 2020-05-28 19:34:17 +02:00
Conner Fromknecht
3faf8bad3f
Merge pull request #4320 from guggero/refactor-log-writer
config+log: remove global RootLogWriter variable
2020-05-27 19:25:32 -07:00
Olaoluwa Osuntokun
d2d8793afd
Merge pull request #4298 from cfromknecht/sub-inv-fixes
channeldb+invoices: minor invoice subscription fixes
2020-05-27 15:56:47 -07:00
Oliver Gugger
70772ab99b
config+lnd+rpcserver: use log writer from cfg 2020-05-27 09:43:59 +02:00
Conner Fromknecht
d0d2ca403d
multi: rename ReadTx to RTx 2020-05-26 18:20:37 -07:00
Conner Fromknecht
5b747715fc
invoices: return error from SubscribeNotifications on shutdown 2020-05-26 17:50:45 -07:00
Oliver Gugger
3afaed8b5c
rpcserver: fix linter error 2020-05-20 09:12:53 +02:00
Oliver Gugger
7f1b865b53
multi: rename server's identityPriv to identityECDH 2020-05-20 09:05:14 +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
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
Oliver Gugger
50e86f88fe
rpcserver+subrpcserver: 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
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
bc3909050e
multi: rename and export logWriter as RootLogWriter 2020-05-14 14:37:50 +02:00
Conner Fromknecht
2f84d1a819
Merge pull request #4280 from cfromknecht/read-for-each-node
channeldb: remove Tx arg from ForEachNode
2020-05-13 16:37:10 -07:00
Conner Fromknecht
90d3bf532d
channeldb+routing: remove tx arg for ForEachNode 2020-05-12 17:53:20 -07:00
Joost Jager
674c199047
routing: return full htlc attempt from router 2020-05-12 19:56:52 +02:00
Joost Jager
c33d94ff27
routing+routerrpc: add multiple outgoing channel restriction 2020-05-12 07:17:24 +02:00
Olaoluwa Osuntokun
3190437188
Merge pull request #4139 from carlaKC/lnrpc-listsweeps
lnrpc: add block height params to GetTransactions and add ListSweeps
2020-05-07 16:44:05 -07:00
carla
f3212057dd
walletrpc: add list sweeps to rpc and cli 2020-05-06 09:25:44 +02:00
carla
537dac3c62
multi: specify start and end height for ListTransactionDetails
Add start and end height parameters to the rpc and cli GetTransactions
endpoints. Default to returning all transactions from genesis to tip,
including unconfirmed transactions to maintain backwards compatibility.
2020-05-05 21:10:06 +02:00
Olaoluwa Osuntokun
cc1dbb5677
channeldb: eliminate extra copy in QueryPayments
In this commit, we eliminate an extraneous copy in the `QueryPayments`
method. Before this commit, we would copy each payment from the initial
FetchPayments call into a new slice. However, pointers to payments are
return from `FetchPayments`, so we can just maintain that same reference
rather than copying again when we want to limit our response.
2020-05-04 12:13:47 -07:00
Conner Fromknecht
1bfe52837d
Merge pull request #4176 from wpaulino/listchannels-uptime-before-server-active
rpcserver: omit uptime in ListChannels response if server not started
2020-04-30 20:33:37 -07:00
Olaoluwa Osuntokun
9f5f48b20d
Merge pull request #4089 from fguisso/acceptor
rpcserver: parameterize acceptortimeout
2020-04-30 19:03:55 -07:00
Joost Jager
f6b2410011
routing+routerrpc: rename max_shards to max_parts
Don't introduce a new term and align with the P in MPP.
2020-04-22 14:49:19 +02:00
Joost Jager
969eecc7d2
routing+routerrpc+lncli: rename MaxHtlcs to MaxShards 2020-04-14 10:31:59 +02:00
Wilmer Paulino
893c0cf843
rpcserver: omit uptime in ListChannels response if server not started
If the server hasn't fully started yet, it's possible that the channel
event store hasn't either, so it won't be able to consume any requests
until then. To prevent blocking, we'll just omit the uptime related
fields for now.
2020-04-10 18:31:46 -07:00
Wilmer Paulino
17ca1d78f0
rpcserver: include upfront shutdown script in ListChannels response
This field could be omitted from the response if we were unable to
calculate the channel's uptime.
2020-04-10 18:26:31 -07:00
Conner Fromknecht
91cd7e633a
lnrpc+rpcserver: expose git commit hash in getinfo 2020-04-10 16:39:31 -07:00
Conner Fromknecht
5c04038c18
bulid: only return semantic version from Version()
The version field in getinfo is kept the same for backwards
compatibility.
2020-04-10 16:39:23 -07:00
Olaoluwa Osuntokun
363caa441a
rpc: allow wumbo invoices
In this commit, we remove the restriction surrounding the largest
invoices that we'll allow a user to create. After #3967 has landed,
users will be able to send in _aggregate_ a payment larger than the
current max HTLC size limit in the network. As a result, we can just
treat that value as the system's MTU, and allow users to request
payments it multiples of that MTU value.

A follow up to this PR at a later time will also allow wumbo _channels_.
However, that requires us to tweak the way we scale CSV values, as post
wumbo, there is no true channel size limit, only the
_local_ limit of a given node. We also need to implement a way for nodes
to signal to other nodes their accepted max channel size.
2020-04-09 19:02:08 -07:00
Joost Jager
e9bd691e6a
routerrpc+routing: adapt payment session for multi shard send
Modifies the payment session to launch additional pathfinding attempts
for lower amounts. If a single shot payment isn't possible, the goal is
to try to complete the payment using multiple htlcs. In previous
commits, the payment lifecycle has been prepared to deal with
partial-amount routes returned from the payment session. It will query
for additional shards if needed.

Additionally a new rpc payment parameter is added that controls the
maximum number of shards that will be used for the payment.
2020-04-09 08:20:49 +02:00
Joost Jager
327634e9f7
routerrpc: move payment marshalling 2020-04-08 08:53:57 +02:00
bitromortac
39c58d9d14 lnrpc: use queried payments to list payments in the rpc
Changes the grpc proto file, generates the protobuf, and
enables a queried way to retrieve payments in the rpc, where
backward compatibility is enforced by returning all payments
in the database by default. Adds a payment index field to
the returned payments of the rpc call.
2020-04-07 07:03:51 +02:00
Olaoluwa Osuntokun
e52c5df8ab
Merge pull request #4140 from carlaKC/lnrpc-pendingchannelinitiator
lnrpc: use initiator enum for pending channel open initiator
2020-04-06 15:46:46 -07:00
carla
d66ff04583
lnrpc: use initiator enum for pending channel channel intiator
Update the PendingChannel message from a bool to an enum to
differentiate between the case where the remote party initiated the
channel and we have no record of the channel initiator. The previous
field has not been included in a release of lnd, so we can replace the
field directly.
2020-04-03 11:26:21 +02:00
carla
2ae61162db
lnrpc: move initiator enum out of close summary
Move enum out of CloseSummary struct for more general use. This does
not change the encoding of the enum, and will only cause compile time
errors for existing clients. This enum has not been included in a
release yet, so we can make this move without much disruption.
2020-04-03 11:26:11 +02:00
Conner Fromknecht
d1fa33c8eb
rpcserver: only block co-op close for frozen chans
This commit fixes a recent issue from #4081 that would prevent a frozen
channel from being force closed via the rpc. We correct this, so that
only the co-op path is inhibited.
2020-04-02 17:40:08 -07:00
Conner Fromknecht
3c371dd633
rpcserver: remove NewLightningChannel usage in CloseChannel 2020-04-02 17:39:47 -07:00
Conner Fromknecht
ec784db511
multi: remove returned error from WipeChannel
The linter complains about not checking the return value from
WipeChannel in certain places. Instead of checking we simply remove the
returned error because the in-memory modifications cannot fail.
2020-04-02 17:39:29 -07:00
Olaoluwa Osuntokun
77df8e3a43
Merge pull request #4130 from cfromknecht/open-channel-refactor
rpcserver: align OpenChannel + OpenChannelSync request parsing
2020-03-31 18:05:00 -07:00
Conner Fromknecht
66d02504f9
rpcserver: align OpenChannel+OpenChannelSync req parsing
This commit consolidates our request parsing for OpenChannel and
OpenChannelSync which removes a good deal of code duplication.
2020-03-31 11:24:13 -07:00
Joost Jager
baffe156db
lnrpc: expose commitment type on pending open and waiting close channels 2020-03-31 19:35:52 +02:00
Joost Jager
41573004a3
lnrpc: extract rpcCommitmentType 2020-03-31 19:35:50 +02:00
Conner Fromknecht
c1f9c56e5b
rpcserver: add self-node check in OpenChannelSync 2020-03-31 10:21:29 -07:00
Conner Fromknecht
303d441d4d
rpcserver: ensure OpenChannel+OpenChannelSync parse NodePubkey 2020-03-31 10:21:29 -07:00
Conner Fromknecht
1823840ed6
rpcserver: add missing channel limit check to OpenChannelSync 2020-03-31 10:21:29 -07:00
Conner Fromknecht
5660a26b60
rpcserver: add wallet sync check to OpenChannel 2020-03-31 10:21:24 -07:00
Oliver Gugger
376a747bb2
rpcserver: implement PSBT funding flow
A PSBT funding flow consists of multiple steps. We add new RPC
messages that can trigger the underlying state machine to transition
to a new state. We also add new response messages that tell the
API user what the current state is.
2020-03-31 09:17:24 +02:00
Andras Banki-Horvath
93cb05142a lnrpc: rename FloatValue to FloatMetric
This commit renames lnrpc.FloatValue to lnrpc.FloatMetric as requested
in the final review of centrality PR.
2020-03-30 16:36:11 +02:00
Olaoluwa Osuntokun
eb10594381
Merge pull request #4092 from Crypt-iQ/peer_ll_0210
link+peer: buffer messages until link active
2020-03-27 13:20:25 -07:00
Andras Banki-Horvath
608354032c autopilot: parallelize betweenness centrality
This commit parallelizes betweenness centrality calculation, by
distributing the algo to N workers and creating partial results.
2020-03-27 13:56:10 +01:00
Andras Banki-Horvath
7e50997bb4 lnrpc: add betweenness centrality to GetNodeMetrics (new RPC call)
This commit extends the RPC interface with GetNodeMetrics will contain
all graph node metrics in the future. Currently only holds betweennes
centrality per node.
2020-03-27 13:56:08 +01:00
nsa
966cd2112c multi: link notifies subscribers of ActiveLinkEvent, rpc ignores 2020-03-27 08:49:46 -04:00
carla
9e1cdb78e7
lnrpc: deprecate unused pending closing channels field
The pending closing channels field was present to cover an edge case
where coperatively closed channels were closed before upgrade and
confirmed after the upgrade. This commit deprecates the field and adds
a warning log to cover these edge cases.
2020-03-25 08:48:19 +02:00
carla
8b83c1f7f9
lnrpc: add commit fees to WaitingPendingClose 2020-03-25 08:45:08 +02:00
carla
fd6b397496
lnrpc: add initiator bool to PendingChannel message 2020-03-25 08:42:26 +02:00
Olaoluwa Osuntokun
1ac7550e3f
chancloser: deny co-op close initiated by the chan initiator for frozen chans 2020-03-23 16:57:03 -07:00
Olaoluwa Osuntokun
8bce48d3cc
lnwallet/chanfunding: add new ThawHeight() method to ShimIntent+CannedAssembler
As frozen channels can only be created via the non-default channel
assembler, we extend both the ShimIntent and CannedAssembler to also
accept and expose this new channel status along with the thaw height.
2020-03-23 16:56:57 -07:00
carla
72e3b0a5d7
lnrpc: add push amount to listchannels 2020-03-19 13:20:26 +02:00
Olaoluwa Osuntokun
071c7cbe78
lnd: convert to use new kvdb abstraction 2020-03-18 19:35:23 -07:00
Joost Jager
e2052f7f65
Merge pull request #3758 from joostjager/anchor-output-poc-joost
cnct: anchor output sweeping and fee bumping
2020-03-18 18:59:06 +01:00
Joost Jager
d60303b092
lnrpc: expose commit hashes for waiting close channels
To make it easier to determine which pending sweep to bump in order to
get your anchor commitment tx confirmed.
2020-03-18 12:27:05 +01:00
Joost Jager
ab451f634e
cnct+lnrpc: report anchor resolution 2020-03-18 12:27:03 +01:00
Joost Jager
d84b596f55
cnct: do not ignore resolver reports after resolution
Preparation for anchor resolver. The recovered anchor amount should
still be included in the pending channel report even after it has been
resolved.

This also fixes an existing bug that in some cases caused the recovered
amount from an htlc resolver not to be included in the total.
2020-03-18 12:26:59 +01:00
Conner Fromknecht
b6a0bfcabe
Merge pull request #3848 from carlaKC/htlcnotifier-3-addhtlcnotifierrpc
[htlcnotifier 4/4]: lnrpc: Add HTLC Event Subscription
2020-03-17 16:37:52 -07:00
fguisso
5ab7dd89e7
rpcserver: parameterize acceptortimeout 2020-03-17 16:43:14 -03:00
carla
4c48d0361d
lnrpc+lncli: display peer errors in listpeers
This change adds a set of errors to the peer struct returned by list
peers. A latest error boolean is added to allow for more succinct
default lncli responses.
2020-03-17 08:22:50 +02:00
Johan T. Halseth
7d305fdc46
lnrpc: add commitment_type to listchannels 2020-03-13 20:00:48 +01:00
carla
67d4bad73f
rpcserver+routerrpc: add subscribe events to router backend
Add SubscribeHtlcEvents to RouterBackend in preparation for the
addition of a HtlcNotifier stream.
2020-03-13 09:30:16 +02:00
Olaoluwa Osuntokun
cbef26b9f6
Merge pull request #3993 from guggero/unconfirmed-chanbackup
chanbackup: update on-disk backup file with unconfirmed channels
2020-03-09 17:18:23 -07:00
Oliver Gugger
9aff896b10
lnrpc+rpcserver+lncli: rename RPC fields to previous JSON name 2020-03-07 11:24:13 +01:00
Conner Fromknecht
11532df5f3
cmd/lncli: add --peer flag to list channels
This commit adds a flag to listchannels that filters by remote pubkey.
2020-03-05 20:44:18 -08:00
Conner Fromknecht
5c9b336a61
lnrpc+rpcserver: expose short chan id on feereport
This commit adds each channel's short chan id to the `feereport` rpc.
Without this, it can be tedious to lookup more info about a particular
channel since most rpcs only accept short chan ids and not channel
points. For instance, now one can take a channel id from `feereport` and
look it up directly via `getchaninfo` to examine the policy in more
detail.
2020-03-04 15:37:17 -08:00
Oliver Gugger
ab024b98ee
rpcserver+itest: remove channel from backup when abandoning it 2020-03-04 10:58:50 +01:00
Oliver Gugger
4e0c276154
rpcserver: don't skip pending channels in backup subscription
The synchronous call to get all channel backups also include
channels that are pending at the moment of the call. A previous
commit added pending channels to the file based backup as well. So
this is the last backup method that needs to be adjusted to also
contain unconfirmed channels.
2020-03-04 10:58:49 +01:00
carla
e74b6f88b7
rpcserver: display open and close initiator 2020-02-21 13:53:51 +02:00
Johan T. Halseth
f16fe7b483
Merge pull request #3916 from chokoboko/rpcserver-remove-duplicated-permission-entity
[trivial] rpcserver: remove duplicated 'address' permission entity
2020-02-11 08:15:34 +01:00
Oliver Gugger
c8b7108eeb
rpcserver: instruct REST marshaler to emit default values
This change instructs the REST proxy server to overwrite its default
JSON marshaler settings. That allows us to set EmitDefaults to true
which will result in all JSON fields returned in REST responses to
be fully populated, even if their values are falsey.
2020-01-27 15:40: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
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
chokoboko
0b9940a398 Remove duplicated address permission entity 2020-01-15 14:03:44 +02: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
Joost Jager
d3fa9767a9
rpc: use more sensible final cltv delta default when sending payments 2020-01-10 21:35:34 +01:00
Olaoluwa Osuntokun
bc176b5aa3
rpc+lnwallet: implement new FundingStateStep RPC method
In this commit, we implement the currently defined transition methods
for the new `FundingStateStep` method. At this point, we're now able to
serve the "responder" of the externally initiated channel funding flow
by being able to register and cancel a funding flow according to its
expected pending channel ID.
2019-12-20 19:09:44 -08:00
Olaoluwa Osuntokun
91bd56dbd1
funding+rpc: expand specified chan point shim into a canned assembler
In this commit, we update the `OpenChannel` method to observe the new
`funding_shim` field in the main open channel request. If this is
specified, and is a channel point shim, then we'll create a custom
`chanfunding.Assembler` for the wallet to use in place of the regular
funding workflow.

With this commit, the "initiator" of an external funding flow can now
delegate the remainder of the channel funding workflow to lnd.
2019-12-20 19:09:41 -08:00
Olaoluwa Osuntokun
3eed38d602
lnrpc: add ability to provide chan point shims for funding, new funding modifiers
In this commit, we start to expose some of the new external funding
functionality over the RPC interface.

First, we add a new `funding_shim` field to the regular `OpenChannel`
method. This can be used by a caller to express that certain parameters
of the funding flow have already been negotiated outside the protocol,
and should be used instead. For example, a shim can be provided to use a
particular key for the commitment key (ideally cold) rather than use one
this is generated by the wallet as normal, or signal that signing will
be carried out in an interactive manner (PSBT based).

Next, we add a brand new method: `FundingStateStep`. FundingStateStep is
an advanced funding related call that allows the caller to either
execute some preparatory steps for a funding workflow, or manually
progress a funding workflow. The primary way a funding flow is
identified is via its pending channel ID. As an example, this method can
be used to specify that we're expecting a funding flow for a particular
pending channel ID, for which we need to use specific parameters.
Alternatively, this can be used to interactively drive PSBT signing for
funding for partially complete funding transactions.

The new transition methods (funding state machine modifiers) in this
commit allow a party to register a funding intent that should be used
for a specified incoming pending channel ID. The "responder" to the
external channel flow should use this to prep lnd to be able to handle
the channel flow properly.
2019-12-20 19:09:38 -08:00
Joost Jager
95ddab57fa
channeldb: add tx argument for FetchLightningNode
To allow execution within an existing tx.
2019-12-20 10:17:01 +01:00
Joost Jager
37d9ee302c
channeldb: take serialized key to fetch lightning node
This prevents inefficient key conversions in a follow up commit that
change the inner pathfinding loop.
2019-12-19 12:44:00 +01:00
Conner Fromknecht
35dd5f354d
routerrpc: parse dest_features bits for manual SendPayment 2019-12-18 23:57:38 -08:00
Conner Fromknecht
f868bc128b
rpcserver+routerrpc: thread features + payment addr to SendPayment 2019-12-18 23:56:59 -08:00
Wilmer Paulino
7f3771e74f
Merge pull request #3796 from carlaKC/3786-setupfrontshutdown
Add Upfront Shutdown Address to OpenChannelRequest
2019-12-18 11:28:29 -08:00
Olaoluwa Osuntokun
6fef37cc06
Merge pull request #3850 from alexbosworth/patch-14
lnrpc: Add macaroon entry for peers subscription
2019-12-18 12:33:01 -03:00
Johan T. Halseth
27337dc973
lnd+rpcserver: use same serverOpts for custom listeners
Earlier we used emtpy grpc server options if custom listeners were set.
This was done to disable TLS. Now, we reuse the same server options as
for the regular listeners, in a move towards enabling TLS also here.
2019-12-18 10:28:22 +01:00
Alex Bosworth
36e0b027ce
lnrpc: Add macaroon entry
Require peers read access to subscribe to peer events
2019-12-17 17:05:49 -08:00
carla
eb3a2e63f2
lnrpc: display local upfront shutdown 2019-12-17 23:21:30 +02:00
carla
6eab2a06dd
lnrpc+lncli: add feature bits to GetInfo 2019-12-17 23:21:14 +02:00
carla
a2f029caca
lnrpc: add upfront shutdown address to open channel request 2019-12-17 23:18:25 +02:00
Johan T. Halseth
fd4153851d
Merge pull request #3397 from carlaKC/peernotifier-addsubscribepeerrpc
lnrpc: Add subscribe peer events rpc
2019-12-17 21:46:24 +01:00
Johan T. Halseth
76dfd6326d
Merge pull request #3799 from carlaKC/chanfitness-bugfix
Bugfix: Chanfitness open time for offline peers
2019-12-17 20:54:34 +01:00
carla
3c28507062
lnrpc: Add subscribe peer events rpc 2019-12-17 21:26:55 +02:00
carla
4f9795e8ae
chanfitness: switch to query by channel outpoint
In this commit, the channelEventStore in the channel
fitness subsystem is changed to identify channels
by their outpoint rather than short channel id. This
change is made made becuase outpoints are the preferred
way to expose references over rpc, and easier to perform
queries within lnd.
2019-12-17 17:36:28 +02:00
carla
47e700ba9e
rpcserver: return uptime errors for known channels
Upgrade logging of channel uptime/lifespan query errors
to returning the error, with the exception of the case
where the channel is known to the store. This error is
logged, due to the potential for race conditions between
the channel event store being notified of a new open
channel and the rpc channel subscription creating a rpc
channel struct (which queries for uptime).
2019-12-17 17:36:27 +02:00
Johan T. Halseth
f0bd4e775b
Merge pull request #3775 from halseth/mobile-listener-signal
[mobile] make Ready signal for custom listeners
2019-12-17 12:26:04 +01:00
Conner Fromknecht
990bdd6b64
lnrpc: display remote peer features via rpc 2019-12-14 07:05:07 -08:00
Conner Fromknecht
db0029d03d
lnrpc: add node features to LightningNode and NodeInfo 2019-12-14 07:04:51 -08:00
Joost Jager
d16476e477
routerrpc+record: move custom set validation 2019-12-12 17:49:34 +01:00
Joost Jager
75b94dec2b
Merge pull request #3819 from joostjager/fix-custom-record-payment
multi: fix custom record payment
2019-12-12 14:33:05 +01:00
Conner Fromknecht
aba49c9a5a
rpcserver: populate features on lnrpc invoices
In the process, we also move the feature serialization into the
invoicesrpc package, so that it can be shared between the invoicesrpc
and main rpcserver.
2019-12-12 00:12:51 -08:00
Olaoluwa Osuntokun
338175534e
Merge pull request #3812 from guggero/sign-custom
signrpc: sign and verify messages with custom key
2019-12-11 18:51:55 -08:00
Joost Jager
d02de70d20
multi: do not use tlv.Record outside wire format handling
This commit prepares for more manipulation of custom records. A list of
tlv.Record types is more difficult to use than the more basic
map[uint64][]byte.

Furthermore fields and variables are renamed to make them more
consistent.
2019-12-12 00:14:58 +01:00
Oliver Gugger
95226771ed
signrpc+rpcserver: add signer macaroon permissions 2019-12-11 22:37:40 +01:00
Joost Jager
b6eb3a69ba
routing+lnrpc+lncli: allow setting min htlc policy 2019-12-11 00:17:08 +01:00
Joost Jager
ddb98fcc41
multi: distinguish between htlc in and out constraints 2019-12-11 00:16:57 +01:00
Conner Fromknecht
1367187454
multi: set invoice feature bits using feature manager 2019-12-10 13:09:52 -08:00
Conner Fromknecht
a168f37b9c
lnwire+rpcserver: populate feature bits on decodepayreq 2019-12-10 13:09:36 -08:00
carla
94d3eb60a4
multi: Use user provided close address for cooperative closes
This commit is adapted from @Bluetegu's original
pull request #1462.

This commit reads an optional address to pay funds out to
from a user iniitiated close channel address. If the channel
already has a shutdown script set, the request will fail if
an address is provided. Otherwise, the cooperative close will
pay out to the address provided.
2019-12-10 09:13:01 +02:00
Olaoluwa Osuntokun
47235e2f98
lnrpc: add msats to return value of DecodePayReq
In this commit, we add `msats` to the return value of `DecodePayReq` to
ensure we always show full value information as we're moving to do
generally for all RPC calls that deal with off-chain amounts.
2019-12-06 15:48:30 -08:00
Conner Fromknecht
abb7f4fa9e
lnrpc+rpcserver: add payment_addr field to PayReq 2019-12-05 07:59:47 -08:00
Joost Jager
352334d470
lnrpc: re-enable custom records
This commit also renames the rpc field for consistency. As it wasn't
functional and the id doesn't change, this isn't considered a breaking
change.
2019-12-04 13:27:33 +01:00
Joost Jager
5d4ceca038
tlv: remove unused error return value
This commit also modifies a previous migration. Because the change is so
limited, we don't consider this a significant risk.
2019-12-04 13:27:29 +01:00
Johan T. Halseth
dc6c040803
lnd: make Ready signal for custom listeners
This allows the caller to know when lnd is ready to accept RPC calls,
which is inmportant for mobile applications where eveything happens in
process.
2019-11-29 11:59:01 +01:00
Joost Jager
2d19201ede
lnrpc+routerrpc+lncli: add allow_self_payments safety flag 2019-11-26 10:15:46 +01:00
Conner Fromknecht
76a2dfd8a6
lnrpc: remove receipt field from invoice 2019-11-22 02:23:24 -08:00