Commit Graph

618 Commits

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