Commit Graph

782 Commits

Author SHA1 Message Date
whythat
1adeb41a9d rpcserver+lnrpc: make Subscribe RPCs context aware
This commit makes all the Subscribe RCP's context aware so that they
stop executing when the request context is cancelled.
2021-04-22 07:49:29 +02:00
Olaoluwa Osuntokun
7b589e5811
routing: add strict zombie pruning as a config level param
In this commit, we add strict zombie pruning as a config level param.
This allow us to add the option for those that want a tighter graph, and
not change the default composition of the channel graph for most users
over night.

In addition, we expand the test case slightly by testing that the self
node won't be pruned, but also that if there's a node with only a single
known stale edge, then both variants will prune that edge.
2021-04-21 13:56:27 -05:00
Pierre Rochard
99cba51849 rpcserver+lnrpc: make graph node addresses consistent
This commit adds a []*lnrpc.NodeAddress typed node_addresses field
on the NodeUpdate message of SubscribeChannelGraph to mirror the
addresses field in the LightningNode message of DescribeGraph.

Fixes https://github.com/lightningnetwork/lnd/issues/4084
2021-04-09 11:29:22 -05:00
GameXG
f980bc38f1 fix #5179 extractPaymentIntent null pointer
payIntent.paymentAddr has not been initialized.
2021-04-07 10:41:31 +08:00
Wilmer Paulino
cb3e179eaf
rpc: break down wallet balance by accounts 2021-04-05 15:41:12 -07:00
Wilmer Paulino
a7211b34c3
rpc: expose account parameter for several wallet RPCs 2021-04-05 15:41:07 -07:00
Wilmer Paulino
f91e7cde59
lnwallet: expose optional account filter for several WalletController methods 2021-04-05 15:41:06 -07:00
Wilmer Paulino
f38bf4d7fa
lnwallet: expose required account parameter for WalletController methods 2021-04-05 15:41:05 -07:00
yyforyongyu
9d0d88ac21
lnrpc+lncli: deprecate sat_per_byte and add sat_per_vbyte
This commit deprecates/replaces the old field `sat_per_byte` with
`sat_per_vbyte`. While the old field suggests sat per byte, it’s
actually using sat per virtual byte. We use the Hidden param to hide all
the deprecated flags. These flags won't show up in help menu onwards,
while stay valid that can be passed from cli. Thus bash scripts
referencing these fields won't be broken.
2021-03-26 17:16:40 +08:00
Olaoluwa Osuntokun
b4b7f29724
Merge pull request #5102 from yyforyongyu/fix-send-cli
lncli+lnrpc: add payment address to sendpayment
2021-03-24 18:02:53 -07:00
Alex Bosworth
61f79d890c
rpcserver: revert target conf to previous behavior
Previously the rpcserver would not use the remote conf target as its local conf target and this behavior is desirable.
2021-03-19 18:43:07 -07:00
Hampus Sjöberg
ada1bc701c signal: handle shutdown properly
This addresses issues related to the mobile lnd builds, where
calling `stopDaemon` and subsequently calling LndMobile's `Start`
results in crash.
2021-03-18 12:54:25 +01:00
yyforyongyu
2dac77200b
lncli+lnrpc: add payment address to sendpayment 2021-03-17 21:16:17 +08:00
Conner Fromknecht
b4aa661d16
Merge pull request #5064 from ellemouton/set-coop-close-target-confs
multi: allow setting target confs for co-op close
2021-03-16 11:14:15 -07:00
Johan T. Halseth
4bbf5c4b6d
rpcserver: use same grpc server for both services
This commit achieves what we have been building up to: running the
WalletUnlockerService and the LightningService on the same gRPC server
simultaneously!

To achieve this, we first create the RPC server in a "interface only"
way, only creating the struct and setting the dependencies we have
available before the wallet has been unlocked. After the wallet has been
unlocked and we have created all the subsystems we need, we add those to
the RPC server, and start the sub-servers.

This means that the WalletUnlockerService and the LightningService both
will be registered and available at all times on the gRPC server.
However, before the wallet has been unlocked, the LightningService
should not be used since the RPC server is not yet ready to handle the
calls. Similarly, after the wallet has been unlocked, the
WalletUnlockerService should not be used. This we will ensure in
following commits.
2021-03-11 13:05:24 +01:00
Johan T. Halseth
82fb22eda2
lnd+rpc: define external subserver config only once
We don't have to define the external subserver config more than once, so
it is not needed to be defined for every listener. Instead we move it to
the ListenerConfig.
2021-03-11 13:05:24 +01:00
Johan T. Halseth
3c81a5dd73
rpcperms: add RPC interceptor chain
This adds a new package rpcperms which houses the InterceptorChain
struct.  This is a central place where we'll craft interceptors to use
for the GRPC server, which includes macaroon enforcement.

This let us add the interceptor chain to the GRPC server before the
macaroon service is ready, allowing us to avoid tearing down the GRPC
server after the wallet has been unlocked.
2021-03-11 13:05:23 +01:00
Johan T. Halseth
4ea494e8c5
lnrpc: wrap subservers in GrpcHandler
In order to be able to register the subservers with the root grpc server
before we have all dependencies available, we wrap them in an
GrpcHandler struct. This struct will initially hold an empty reference
to the subservers, which allows us to register with the GRPC server, and
later populate and create the subserver instance.
2021-03-11 13:05:23 +01:00
Olaoluwa Osuntokun
65b0bbcd53
Merge pull request #5033 from robot-dreams/set-channel-status
Add lncli command / RPC for manually setting channel state
2021-03-09 18:12:08 -08:00
Yaacov Akiba Slama
4bab68a808 lnrpc: add timestamp_ns field to ForwardingEvent msg
This allows to use FowardingHistory rpc method to receive the data exactly
as it's stored in lnd and to synchronize incrementally the history to an
external database.
2021-03-05 16:26:28 -08:00
Elle Mouton
9e9c48fcdd rpc: use default if conf-target is not set
This commit uses the new coop-close-target-confs value as the default to
use for a nodes self initiated channel closures if the conf-target flag
for the channel closure is not set. The defaults for both these options
is 6 so this shouldnt change current behaviour.
2021-03-04 13:07:30 +02:00
Elliott Jin
ce2796257e multi: move GetChanPointFundingTxid from lnd to lnrpc
This refactor-only change makes the GetChanPointFundingTxid helper
function available from sub-systems outside of the root lnd package.
2021-02-24 07:13:28 -08:00
Elliott Jin
db76b970ac routerrpc: expose SetChannel* methods from Router backend
Allow router RPC requests to call into the ChanStatusManager to
manually update channel state.
2021-02-24 07:13:28 -08:00
Johan T. Halseth
59f41e518d
channeldb: add failedHtlcsOnly option to DeletePayments 2021-02-22 12:50:25 +01:00
Johan T. Halseth
7e3738d773
rpcserver+channeldb: delete only failed payments if requested 2021-02-22 12:50:25 +01:00
Conner Fromknecht
7f006832fb
Merge pull request #4934 from cfromknecht/pinned-active-syncers
discovery: pinned syncers
2021-02-03 10:54:00 -08:00
Andras Banki-Horvath
dde5750160
invoices+rpc: add missing channel graph to the AddInvoiceConfig
The Graph which is referenced later in the AddInvoice call graph is
unset when adding a hodl invoice. This resulted in a crash.
2021-02-03 11:33:27 +01:00
Conner Fromknecht
bd1c5378bf
Merge pull request #4919 from joostjager/getnodeinfo-notfound
rpcserver: use NotFound http status code in GetNodeInfo
2021-01-31 09:43:33 -08:00
Conner Fromknecht
2371fc5a8e
lnrpc: expose PINNED_SYNC for listpeers 2021-01-29 00:19:47 -08:00
Johan T. Halseth
422008e3c0
lnwallet+funding+rpcserver: check reserved value before
PublishTransaction

For a few manual send cases that can be initiated by the user, we check
the reserved value.
2021-01-19 20:06:52 +01:00
Johan T. Halseth
185ba77f8e
sweep: allow specified outputs to sweep tx
We'll use this to attach an output for the value reserved for anchor
commitments fee bumping if the user requests a send_all transaction.
2021-01-19 10:53:45 +01:00
Joost Jager
626983b352 rpcserver: use NotFound http status code in GetNodeInfo 2021-01-14 13:59:56 +01:00
Oliver Gugger
49edb2b524
rpcserver: fix log statement in channelbalance
Fixes a typo and missing format 'verb' in the RPCS debug log.
2020-12-22 09:39:43 +01:00
eugene
dcdf36f410 lnd+funding: move Manager to funding, change references 2020-12-17 10:45:05 -05:00
eugene
936227798a lnd: remove openChanReq, call InitFundingWorkflow with InitFundingMsg 2020-12-17 09:50:48 -05:00
eugene
caa0f5da6a multi: move and export funding-related vars to funding package
Also moves the lnd global MaxFundingAmount to server.go
2020-12-17 09:36:34 -05:00
Johan T. Halseth
e13c97d621
Merge pull request #4841 from cfromknecht/send-coins-log-fix
rpcserver: replace sweep_all in log with send_all to match rpc arg
2020-12-08 13:56:41 +01:00
Conner Fromknecht
b017ab67c4
rpcserver: replace sweep_all in log with send_all to match rpc arg 2020-12-07 13:45:11 -08:00
Andras Banki-Horvath
98c61be342
routing: add missing GlobalFeatures to NetworkNodeUpdate 2020-12-07 15:47:09 +01:00
Olaoluwa Osuntokun
94f8311667
Merge pull request #4782 from cfromknecht/anchor-wtserver
watchtower: anchor channel support
2020-11-30 17:49:32 -08:00
Olaoluwa Osuntokun
43fc84919e
lnrpc: include payment addr in main Invoice proto
With this change ListInvoices will return the payment addr, and the
response to AddInvoice will as well.
2020-11-25 16:32:05 -08:00
Conner Fromknecht
5b3a08a1cd
multi: thread anchor client down to wtclient subserver 2020-11-25 16:16:28 -08:00
Johan T. Halseth
aa8fa9d0cf
sweep: pass dustLimit to CreateSweepTx 2020-11-20 13:06:53 +01: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
9042a79db2
Merge pull request #4683 from carlaKC/4471-acceptorupfrontshutdown
channelacceptor: add new fields to acceptor response
2020-11-11 17:43:52 -08:00
Johan T. Halseth
a2a924e1e5
rpcserver: move TLS listen config to closure 2020-11-11 09:37:52 +01: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
0d35ce7561
mutli: move parse upfront shutdown out of rpcserver 2020-11-10 11:40:52 +02:00
carla
54c3e98b40
multi: move channel acceptor logic out of rpcserver
This commit moves and partially refactors the channel acceptor logic
added in c2a6c86e into the channel acceptor package. This allows us to
use the same logic in our unit tests as the rpcserver, rather than
needing to replicate it in unit tests.

Two changes are made to the existing implementation:
- Rather than having the Accept function run a closure, the closure
  originally used in the rpcserver is moved directly into Accept
- The done channel used to signal client exit is moved into the acceptor
  because the rpc server does not need knowledge of this detail (in
  addition to other fields required for mocking the actual rpc).

Crediting orginal committer as co-author:
Co-authored-by: Crypt-iQ
2020-11-10 11:38:45 +02:00
Roei Erez
4463a4ce17 invoicerpc: Allow user specify routing hints. 2020-11-06 17:54:20 +02:00