Commit Graph

534 Commits

Author SHA1 Message Date
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
Olaoluwa Osuntokun
7eca7b02a6
Merge pull request #3390 from joostjager/invoice-circuits
channeldb+cnct+invoices: track invoice htlcs
2019-09-04 19:51:37 -07:00
Joost Jager
c1345a4117
multi: use separate cltv expiry field from invoice
Now that the Invoice struct contains the decoded final cltv delta value,
the decoding of payment requests can be removed from the invoice
registry.
2019-09-04 19:20:19 +02:00
Wilmer Paulino
d7364d0f28
rpc: populate missing fields for waiting close channels 2019-09-03 14:25:03 -07:00
Conner Fromknecht
d08721b32d
rpcserver: correctly compute edge-level lastUpdate 2019-08-28 13:31:12 -07:00
Conner Fromknecht
2ebd76bbbb
rpcserver: marshal db edges by increasing pubkey 2019-08-28 13:30:06 -07:00
Olaoluwa Osuntokun
763cb6c09d
lnrpc+lnrpc/routerrpc: add a new TLV record field to the Hop proto
In this commit, we add a new field to the Hop proto to allow callers to
be able to specify TLV records for the SendToRoute call, and also to be
able to display TLV records that were used during regular path finding.

We also update SendPayment to support dest TLV records.
2019-08-22 18:53:03 -07:00
Joost Jager
4dd054ae90
multi: remove debug invoices
Debug invoices are rarely used nowadays, but keep asking for maintenance
every time refactoring in primarily the invoice registry occurs. We have
passed the cost/benefit tipping point, so therefore the debug invoice
concept is removed in this commit.

Previously the debughtlc flag also controlled whether hodl masks were
active. It is safe to remove that additional condition because the hodl
masks are still guarded by the dev build tag.
2019-08-14 21:33:03 +02:00
Olaoluwa Osuntokun
4e62e8ae67
Merge pull request #3355 from wpaulino/is-graph-synced
discovery+rpc: expose graph synced status within GetInfo
2019-08-12 18:22:45 -07:00
Olaoluwa Osuntokun
ed954785b2
rpc: add unary+streaming interceptors to log all errors
Not all errors that occur when serving client requests in the gRPC
server are logged. As a result, at times, we can be lacking critic
information that can be used to debug issues that pop up. With this PR,
we create a basic streaming+unary interceptor that will log all errors
that occur when servicing calls.

The current format looks something like this in the logs when an error
occurs:

```
[ERR] RPCS: [/lnrpc.Lightning/SendCoins]: decoded address is of unknown format
```
2019-08-06 19:41:41 -07:00
Wilmer Paulino
8ca2c79bfe
rpc: expose graph synced status within GetInfo 2019-08-06 17:56:56 -07:00
Wilmer Paulino
8f010abac5
multi: add watchtower client RPC subserver 2019-07-30 15:18:15 -07:00
Conner Fromknecht
97d8be7f6a
rpcserver: query and set num_zombie_chans in NetworkInfo resp 2019-07-16 16:32:27 -07:00
ccdle12
a93d63f04b
lnrpc+rpcserver: Adding last_update timestamp to RoutingPolicy
lnrpc/rpc.proto: updates RoutingPolicy last_update number

rpcserver: adding LastUpdate field to marshalDbEdge

This commit adds a LastUpdate field to each RoutingPolicy, it will show
the time each RoutingPolicy was updated.

lnrpc: regenerating proto files
2019-07-11 07:44:28 +01:00
Roei Erez
404abcbd04 rpc: add channel reserve fields in RPC responses.
In this commit two fields were added to the Channl RPC result in both
open and pending states.
The fields: local_chan_reserve, remote_chan_reserve represents the
reservation the nodes are rquired to keep in both sides of the channel.
This is usefull when calculating the "real" inbound and outbound
liquidity in an accurate way.
2019-07-11 00:03:20 +03:00
Johan T. Halseth
7a5247b766
Merge pull request #3245 from breez/non_static_permissions
rpc: fix calculating RPC permissions.
2019-07-10 13:33:54 +02:00
Roei Erez
46489050ef rpc: make RPC permissions non static.
This commit fixes a but where restarting LND at the same process causes
It to fail.
The problem resides in the fact that an array of permissions is
initialized as a package variable and when creating the
RPCServer all subserver permissions are appended while checking for
duplicates.
On subsequent restart this array is left over from the previous run and
being populated again with the same permissions causing a duplicate
error.
The solution is simple, just to extract out the initial permissions to
a separate function and call it from the context is is needed.
2019-07-10 13:10:24 +03:00
Wilmer Paulino
f819002b7a
Merge pull request #1933 from yaslama/transactions-addresses
Add addresses to transactions returned by SubscribeTransactions
2019-07-10 02:34:31 -07:00
Johan T. Halseth
25375d603c
Merge pull request #3246 from tyzbit/fwdinghistory_3240
rpcserver: ForwardingHistory end_time defaults to time.Now()
2019-07-10 09:56:00 +02:00
Yaacov Akiba Slama
46a611cd90 Add DestAddresses field in transactions returned by SubscribeTransactions 2019-07-10 09:40:41 +03:00
carla
af10009c93 lnrpc: Deprecate fee field in payment struct 2019-07-09 09:58:20 -04:00
tyzbit
d9179bee91 rpcserver: ForwardingHistory end_time defaults to time.Now()
In this commit we change the default behavior
of end_time when calling ForwardingHistory.
end_time now defaults to time.Now()
2019-07-08 18:18:35 -04:00