Commit Graph

555 Commits

Author SHA1 Message Date
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
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
Olaoluwa Osuntokun
6f9fcfaccc
Merge pull request #3499 from cfromknecht/mpp-payments-rpc
channeldb+rpcserver: expose legacy payments as multi-path payments
2019-11-21 18:38:53 -08:00
Olaoluwa Osuntokun
32965fd4be
rpc: update AbandonChannel to remove state from cnct, nursery and graph
In this commit, we update the `AbandonChannel` method to also remove the
state from the countract court as well as the channel graph. Abandoning
a channel is now a three step process: remove from the open channel
state, remove from the graph, remove from the contract court. Between
any step it's possible that the users restarts the process all over
again. As a result, each of the steps below are intended to be
idempotent.

We also update the integration test to assert that no channel is found
in the graph any longer. Before this commit, this test would fail as the
channel was still found in the graph, which can cause other issues for
an operational daemon.

Fixes #3716.
2019-11-20 17:42:58 -08:00
Conner Fromknecht
997500b08d
lnrpc+rpcserver: populate experimental MPP fields in ListPayment rpc 2019-11-19 20:41:44 -08:00
Conner Fromknecht
77602451b8
channeldb: add MPPayment from FetchPayments 2019-11-19 20:41:08 -08:00
Conner Fromknecht
fbd599a2cb
multi: rename Payment.PaymentPreimage to Payment.Preimage
Preliminary step to exposing PaymentPreimage() as a method that can be
shared between legacy payments and mutli-path payments.
2019-11-19 20:40:29 -08:00
Joost Jager
f28941c7e4
routing+routerrpc+lncli: enable last hop restriction for payments 2019-11-18 21:03:03 +01:00
Joost Jager
88f037f8fd
Merge pull request #3729 from joostjager/invoice-msat
invoicesrpc+lnrpc: add msat fields to invoices
2019-11-18 08:39:16 +01:00
Johan T. Halseth
840051cc3d
Merge pull request #3644 from joostjager/commit-sweep-no-nursery
cnct: commit sweep without nursery
2019-11-15 10:38:57 +01:00
Joost Jager
fcbf1bc07a
invoicesrpc+lnrpc: add msat fields to invoices 2019-11-15 08:59:35 +01:00
Joost Jager
9acb236665
cnct: remove nursery dependency in commit sweep resolver
The channel arbitrator no longer passes the direct commitment output to
the nursery for incubation. Instead the resolver itself will await the
csv lock if any.

The reason to change this now is to prevent having to deal with the
(legacy) nursery code for a planned anchor outputs related change to the
commit sweep resolver (also csv lock to_remote).

It is no problem if there are any lingering incubating outputs at the
time of upgrade. This just means that the output will be offered twice
to the sweeper and this doesn't hurt.
2019-11-14 13:38:01 +01:00
Joost Jager
09b3101b80
lnrpc+routerrpc+lncli: add amt and fee limit msat fields 2019-11-13 10:32:35 +01:00
Joost Jager
1597a92160
cnct: add resolver report output type
This commit prepares for the commit sweep resolver to report on its
state.
2019-11-13 10:17:28 +01:00
Joost Jager
e0a3f803d5
lnrpc: extract fee limit calculation 2019-11-12 14:24:53 +01:00
Olaoluwa Osuntokun
777ed104a3
chainfee: create new chainfee package extracting fees from lnwallet
In this commit, we create a new chainfee package, that houses all fee
related functionality used within the codebase. The creation of this new
package furthers our long-term goal of extracting functionality from the
bloated `lnwallet` package into new distinct packages. Additionally,
this new packages resolves a class of import cycle that could arise if a
new package that was imported by something in `lnwallet` wanted to use
the existing fee related functions in the prior `lnwallet` package.
2019-10-31 16:41:57 -07:00
Wilmer Paulino
13b56d5849
Merge pull request #3632 from wpaulino/server-not-active-closechannel
rpcserver: ensure server has started before CloseChannel
2019-10-28 17:01:21 -04:00
carla
31bf542276 lnrpc: Add experimential uptime and lifetime fields to list channels
This commit adds the total observed lifetime of a channel and the
totaluptime of its remote peer to the lnrpc channel struct. These
fields are marked as experimential because they are subject to
change.
2019-10-25 11:41:16 +02:00
Olaoluwa Osuntokun
fe597b6310
rpc: add forgotten 'address' entity to validEntities
The `address` entity is used by the `WalletKit` sub-server for certain
calls.
2019-10-24 19:44:24 -07:00
Olaoluwa Osuntokun
b110a3a197
Merge pull request #1160 from guggero/new-macaroon
lncli: add command to create new macaroon
2019-10-24 19:41:51 -07:00
Wilmer Paulino
a469d5dc2c
Merge pull request #2327 from ottosuess/invoice_macaroon_permissions
lnrpc: allow invoice.macaroon to read onchain transactions
2019-10-24 12:15:16 -04:00
Oliver Gugger
6a463de7a2
lnrpc: add command for baking new macaroons 2019-10-24 10:25:32 +02:00
Wilmer Paulino
dd55d43520
rpcserver: ensure server has started before CloseChannel
We do this as a general sanity check to ensure channels cannot be closed
while either the backend is still syncing or the server is still
starting.
2019-10-23 17:40:38 -04:00
Wilmer Paulino
955d143c1b
server+lntest: extract ErrServerNotActive error 2019-10-23 17:37:15 -04:00
bitromortac
3af91fc9b9 lnd+lnrpc: add msat forwarding amount fields to ForwardingHistory 2019-10-16 19:50:58 +02:00
Conner Fromknecht
c10eacaa24
Merge pull request #3532 from guggero/refactor-log-writer
build+lnd: refactor reusable log file rotator code into build package
2019-10-16 12:59:39 +02:00
Oliver Gugger
3ca2c363fe
lnd+rpcserver: initialize new log writer correctly 2019-10-14 14:56:32 +02:00
Oliver Gugger
3ea74c4362
build: move log level parse code and add new leveled sub logger interface 2019-10-14 14:56:30 +02:00
Wilmer Paulino
0fc401de19
routing+routerrpc: take max cltv limit into account within path finding
With the introduction of the max CLTV limit parameter, nodes are able to
reject HTLCs that exceed it. This should also be applied to path
finding, otherwise HTLCs crafted by the same node that exceed it never
left the switch. This wasn't a big deal since the previous max CLTV
limit was ~5000 blocks. Once it was lowered to 1008, the issue became
more apparent. Therefore, all of our path finding attempts now have a
restriction of said limit in in order to properly carry out HTLCs to the
network.
2019-10-11 18:04:49 -04:00
Olaoluwa Osuntokun
2a3538fec8
Merge pull request #3360 from tyzbit/3357_start-time
rpcserver: startTime defaults to the unix epoch
2019-10-07 16:48:23 -07:00
tyzbit
8891346cb2 rpcserver: startTime defaults to the unix epoch
Fixes https://github.com/lightningnetwork/lnd/issues/3357.  When
start_time isn't specified, its default value is 0.  This meant when
users explicitly specified a start_time of 0, we would incorrectly set
start_time to 24 hours in the past.  Now, n0 means n0.
2019-10-03 18:12:21 -04:00
Joost Jager
b58dbb2d70
multi: fix canceled spelling 2019-10-03 17:27:36 +02:00
Lars Lehtonen
fa26359dd6
rpcserver: stdlib context 2019-09-28 15:46:21 -07:00
Johan T. Halseth
7fcac54dff
Merge pull request #3531 from LightningPeach/fix-tx-subscr
Add BlockHeight param to SubscribeTransactions when tx is confirmed
2019-09-26 09:26:25 +02:00
Olaoluwa Osuntokun
8ce76fff51
lnrpc: add new StaticRemoteKey field to ListChannels output 2019-09-25 18:26:07 -07:00
nsa
c2a6c86e6b
rpcserver: adding ChannelAcceptor bidirectional streaming 2019-09-25 12:07:30 -04:00
nsa
7c6cee7c4f
lnrpc: updating protos to include ChannelAcceptor 2019-09-25 12:07:28 -04:00
Vadym Popov
850085782a
rpcserver: add BlockHeight param to SubscribeTransactions stream 2019-09-23 14:30:44 +03:00
Valentine Wallace
4b9da07e78
rpcserver+lnrpc: allow users to update max HTLC channel policies
In this commit, we enable callers of UpdateChannelPolicy to
specify their desired max HTLC forwarding policy for one or
multiple channels.
2019-09-23 13:07:12 +02:00
Joost Jager
c80feeb4b3
routing+discovery: extract local channel manager
The policy update logic that resided part in the gossiper and
part in the rpc server is extracted into its own object.

This prepares for additional validation logic to be added for policy
updates that would otherwise make the gossiper heavier.

It is also a small first step towards separation of our own channel data
from the rest of the graph.
2019-09-23 13:07:08 +02:00
Joost Jager
1e0ed1e52f
multi: fix dropped errors 2019-09-13 09:50:38 +02:00
Joost Jager
3d7de2ad39
multi: remove dead code 2019-09-10 17:21:59 +02:00
Valentine Wallace
8ce7f82da0 discovery+switch: apply zero forwarding policy updates in-memory as well as on disk
In this commit, we fix a bug where if a user updates a forwarding policy to be
zero, the update will be applied to the policy correctly on-disk, but not
in-memory.

We solve this issue by having the gossiper return the list of on-disk updated
policies and passing these policies to the switch, so the switch can assume
that zero-valued fields are intentional and not just uninitialized.
2019-09-09 23:39:44 -07:00
Johan T. Halseth
2562fdbdda
lnd+rpcserver: extract listener setup into closure 2019-09-05 09:22:54 +02:00