Commit Graph

510 Commits

Author SHA1 Message Date
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
Johan T. Halseth
8b83f03308
rpcserver+router: log terminal sendPayment error 2019-07-01 16:22:57 -07:00
Olaoluwa Osuntokun
c68f747b4f
Merge pull request #3227 from 2xic/issue_3074
lnd: reject custom fee when force closing channel
2019-06-28 13:37:21 -07:00
2xic
fcaf8c029b lnd: reject custom fee when force closing channel 2019-06-21 11:14:13 +02:00
Conner Fromknecht
59c9418eca
lnd+rpcserver: thread watchtower into subserver configs 2019-06-20 17:04:04 -07:00
Olaoluwa Osuntokun
b89b27e6ef
Merge pull request #3212 from cfromknecht/getnodeinfo-hide-chans-default
rpcserver: hide channels in getnodeinfo by default
2019-06-18 17:24:20 -07:00
Olaoluwa Osuntokun
df53c32489
Merge pull request #3139 from Roasbeef/zero-fees
rpc: update updatechanpolicy to allow zero fees
2019-06-17 18:16:38 -07:00
Conner Fromknecht
0adc45ab5a
rpcserver: wrap closure args to 80 chars 2019-06-17 11:09:27 -07:00
Conner Fromknecht
a1a3290bda
rpcserver: conditionally include channels in GetNodeInfoResponse 2019-06-17 11:08:44 -07:00
Conner Fromknecht
8ab56b2a5c
rpcserver: add missing channelbalance log 2019-06-13 19:54:20 -07:00
Olaoluwa Osuntokun
d333b2d981
lnrpc: rename non_succeeded to include_incomplete 2019-06-13 16:01:10 -07:00
Johan T. Halseth
0aec3fd230
rpcserver: filter out non-suceeded payments, include payment status
Earlier versions of ListPayments only included completed payments. We
return to this behavior by ignore all other payments if the nonSucceeded
boolean is not set in the request.
2019-06-12 08:57:47 +02:00
Olaoluwa Osuntokun
89f6db11e6
Merge pull request #3134 from valentinewallace/grpc-perf-interceptor
Add gRPC performance Prometheus exporter.
2019-06-12 06:41:14 +02:00
Olaoluwa Osuntokun
faf0dc3d81
Merge pull request #3174 from Roasbeef/raw-tx-hex-get-transactions
multi: add raw tx hex to GetTransactions response
2019-06-12 06:08:34 +02:00
Olaoluwa Osuntokun
1185c48f58
rpc: set new raw tx hex in SubscribeTransactions resp 2019-06-11 20:58:37 -07:00
Valentine Wallace
f5eeb05e0a
rpcserver+monitoring/config: enable Prometheus monitoring.
Start the Prometheus exporter in rpcserver.go if monitoring is enabled through the
build tag. Also allow users to specify what address they want the Prometheus
exporter to be listening on.
2019-06-11 11:26:09 -07:00
Joost Jager
2e920de292
routing+lnrpc: move default payment timeout out of router
This commit moves the default timeout out of router and thereby fixes a
bug that caused SendToRoute to not return the actual error, but a
timeout result instead. SendToRoute only tries a single route, so a
timeout should never happen.
2019-06-11 08:36:17 +02:00
Olaoluwa Osuntokun
414f501e2b
rpc: set new RawTxHex field in GetTransactions response 2019-06-07 07:38:02 -07:00
Wilmer Paulino
d01f88ecdc
lnrpc/walletrpc: expose pending input sweeps within UtxoSweeper over RPC 2019-06-05 12:10:33 -07:00
Joost Jager
f03533c67a
routerrpc: convert sendpayment to async
Modify the routerrpc SendPayment api to asynchronous. This allows
callers to pick up a payment after the rpc connection was lost or lnd
was restarted.
2019-06-05 12:41:53 +02:00
Joost Jager
eb700d35e1
routerrpc: extend payment request parameters
Add missing parameters to routerrpc version of SendPayment.
2019-06-05 12:41:45 +02:00
Joost Jager
19d5f8f82c
routing: move default cltv assignment out of router
This commit lifts default setting up to the rpc server level, in line
with other payment defaults.
2019-06-05 12:41:43 +02:00
Joost Jager
afd86763ac
lntypes: add ZeroHash 2019-06-05 12:41:41 +02:00
Joost Jager
68f2a04f42
routerrpc: expose mission control reset rpc 2019-06-04 10:00:17 +02:00