Commit Graph

682 Commits

Author SHA1 Message Date
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