Commit Graph

854 Commits

Author SHA1 Message Date
yyforyongyu
eb11d4866f
rpcserver: add remote balance for pending force close 2021-12-14 03:40:48 +08:00
Bjarne Magnussen
93e5de9306
lnrpc: refactor populating lnrpc.Transaction inside SubscribeTransaction 2021-12-10 08:26:16 +01:00
yyforyongyu
53e02fa83d
rpcserver: expose ChanStatusFlags in pending close
This commit exposes the ChanStatusFlags inside waitingCloseResp such
that the channel close type is exposed.
2021-12-08 04:50:23 +08:00
Olaoluwa Osuntokun
67e18e6089
rpc: optimize DescribeGraph by caching the response
Unfortunately, we can't use the graph cache directly here as it doesn't
include all the information we need, since it only includes the minimal
amount of information needed for path finding.

Instead, we use a simple mutex guarded cache that evicts itself after a
certain interval. The default is set small enough that most users
shouldn't really notice. We also provide a way to disable the cache, and
also disable the cache in the itests.

Fixes https://github.com/lightningnetwork/lnd/issues/1232
2021-11-04 15:30:31 -07:00
Olaoluwa Osuntokun
79406696ad
rpc: optimize GetNetworkInfo by using the channel graph cache 2021-11-04 15:30:29 -07:00
Alex Bosworth
6a1283cf0b
lnrpc: log channel point in coop close warning
Use `Warnf` to include the chanpoint in the warning message instead of printing `%v` to the log
2021-10-22 13:20:55 -07:00
Wilmer Paulino
c9f6d788e2
lnrpc: add new CommitmentType for script enforced leased channels 2021-10-19 18:30:43 -07:00
Olaoluwa Osuntokun
e6c65f1cbd
Merge pull request #5346 from joostjager/custom-messages
lnrpc+peer: custom peer messages
2021-10-18 19:07:39 -07:00
Joost Jager
ade50d0b2c
lnrpc: receive custom message 2021-10-15 17:08:55 +02:00
Joost Jager
ae959b16ae
lnrpc: send custom message 2021-10-15 17:08:53 +02:00
Oliver Gugger
1541b2ef1b
multi: create and list all default internal accounts 2021-10-14 15:42:56 +02:00
Oliver Gugger
a3addcc927
multi: forward SendCoins call over RPC 2021-10-14 15:42:52 +02:00
Oliver Gugger
0e279eb15a
multi: refactor external subserver config
As a preparation for making more and more implementation details
configurable, we add a new ImplementationCfg struct that houses all the
interfaces that can be defined externally.
2021-10-08 12:08:23 +02:00
Oliver Gugger
8b7c88537c
multi: refactor SignDigestCompact into SignMessageCompact
To make it possible to use a remote lnrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
lnrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:52 +02:00
Olaoluwa Osuntokun
d630b95c8b
Merge pull request #5777 from orbitalturtle/buf-pass-macaroon
Lnd: Listen for RPC calls on a bufconn
2021-10-07 18:50:58 -07:00
Oliver Gugger
51d19dad87
Merge pull request #5363 from guggero/psbt-no-final-tx
Allow skipping `PsbtFinalize` step during channel funding to support external broadcast
2021-10-04 12:37:51 +02:00
Oliver Gugger
692ea25295
Merge pull request #5642 from guggero/in-memory-graph
In-memory graph cache for faster pathfinding
2021-10-04 11:20:23 +02:00
Oliver Gugger
1608faf199
multi: allow skipping the PSBT finalize step
The FundingPsbtFinalize step is a safety measure that assures the final
signed funding transaction has the same TXID as was registered during
the funding flow and was used for the commitment transactions.
This step is cumbersome to use if the whole funding process is completed
external to lnd. We allow the finalize step to be skipped for such
cases. The API user/script will need to make sure things are verified
(and possibly cleaned up) properly.
2021-10-04 11:17:08 +02:00
Turtle
218fa1e43e
Rpcserver: Add GetAllPermissions function for retrieving permissions for external macaroon baking 2021-10-01 16:51:16 -05:00
Bjarne Magnussen
a5a477e311
lnd: add optional change output index to check reserved wallet balance 2021-10-01 08:21:29 +02:00
eugene
fdcd726f9a
multi: replace DefaultDustLimit with script-specific DustLimitForSize
This commit updates call-sites to use the proper dust limits for
various script types. This also updates the default dust limit used
in the funding flow to be 354 satoshis instead of 573 satoshis.
2021-09-29 13:33:10 -04:00
Oliver Gugger
d6fa912188
multi: further decouple graph
To further separate the channel graph from the channel state, we
refactor the AddrsForNode method to use the graphs's public methods
instead of directly accessing any buckets. This makes sure that we can
have the channel state cached with just its buckets while not using a
kvdb level cache for the graph.
At the same time we refactor the graph's test to also be less dependent
upon the channel state DB.
2021-09-29 17:00:03 +02:00
Andras Banki-Horvath
11cf4216e4
multi: move all channelstate operations to ChannelStateDB 2021-09-29 17:00:03 +02:00
Oliver Gugger
ddea833d31
multi: extract address source into interface
As a preparation to have the method for querying the addresses of a node
separate from the channel state, we extract that method out into its own
interface.
2021-09-29 17:00:03 +02:00
Olaoluwa Osuntokun
884cc0d191
Merge pull request #5768 from priyanshiiit/lookupInvoice
lnd: adds NOT_FOUND status code for LookupInvoice
2021-09-28 14:33:29 -07:00
Oliver Gugger
410606b082
Merge pull request #5797 from guggero/fix-nil-channel
rpcserver: fix nil issue with historical channels
2021-09-28 11:02:12 +02:00
Olaoluwa Osuntokun
7bde1662e2
multi: move breach arbiter and utxo nursery into contractcourt package
In this commit, we take an initial step towards converting the existing
breach arbiter and utxo nursery logic into contract resolvers by moving
the files as is, into the `contractcourt` pacakge.

This commit is primarily move only, though we had to massage some
interfaces and config names along the way to make things compile and the
tests run properly.
2021-09-27 19:10:31 -07:00
Oliver Gugger
e067dc73b7
rpcserver: fix nil issue with historical channels [skip ci]
Fixes #5796.
Some historical channels might not have the forwarding packages
recorded. And since the error might be silenced, the historical channel
might be nil.
2021-09-27 22:26:03 +02:00
yyforyongyu
16f97e6f41
rpcserver: return total num of fwdPkgs in PendingChannels
This commit adds a new field, NumForwardingPackages, in the
PendingChannels RPC response to specify how many forwarding packages the
channel has.
2021-09-23 13:23:13 +08:00
github2k20
2e4318b0ad rpcserver: adds NOT_FOUND status code for LookupInvoice 2021-09-22 14:01:11 +05:30
Oliver Gugger
efe5f6ae90
multi: add RPC middleware interception
With the middleware handler in place, we now need to add a new gRPC
interceptor to the interceptor chain that will send messages to the
registered middlewares for each event that could be of interest to them.
2021-09-20 17:04:29 +02:00
Oliver Gugger
96ea4bf05e
rpcserver+macaroons: extract RawMacaroonFromContext
We'll re-use the code for extracting a macaroon from a request context
later on so we extract it into its own exported function.
2021-09-20 13:05:33 +02:00
ErikEk
46e9481e6c routing: invalid channels updatechanpolicy call 2021-09-15 10:20:49 +02:00
Turtle
72a46b8673
rpcserver: Add flag to BakeMacaroonRequest for allowing external permissions 2021-09-14 16:27:01 -05:00
Turtle
d10a682fa9
macaroons+rpcserver: Add new RPC call for checking macaroon permissions 2021-09-14 16:26:28 -05:00
yyforyongyu
286ca35bf4
rpcserver: check server is started in ExportAllChannelBackups 2021-09-14 07:34:10 +08:00
Bjarne Magnussen
7f53656753
lnd: add DeletePayment to the RPC
The RPC DeletePayment allows deleteing  single payment from its ID. When calling with `FailedHtlcsOnly` set in the request only failed HTLCs of this payment will be deleted.
2021-09-13 12:50:40 +02:00
ErikEk
195e57025b lncli: remove error logs 2021-09-06 19:12:43 +02:00
Andras Banki-Horvath
c5c956bbef
lnrpc: add BatchOpenChannel RPC 2021-09-02 12:13:47 +02:00
Oliver Gugger
37d0d651c4
rpcserver: extract abandonChan method
We'll want to re-use the abandon channel functionality for the batch
funding, as a cleanup in case the funding is aborted before publishing
any transaction.
2021-09-02 12:13:46 +02:00
Olaoluwa Osuntokun
5a9f499dd5
rpc: add new commitment_type field to OpenChannelRequest
This field will be examined later down the stack along with the set of
feature bits to determine if explicit channel commitment type
negotiation is possible or not.
2021-08-30 19:17:28 -07:00
Olaoluwa Osuntokun
00d275d9f0
lnrpc+rpc: expose last ping message received by peer over ListPeers resp 2021-08-25 16:47:17 -07:00
Joost Jager
3f775778c3
channeldb+routing: add tx parameter
Adds an optional tx parameter to ForAllOutgoingChannels and FetchChannel
so that data can be queried within the context of an existing database
transaction.
2021-08-24 13:43:24 +02:00
eugene
d0191cb5ed
rpcserver: validate FinalCltvDelta and CltvLimit for REST
Missed this check in PR #5293.
2021-08-11 15:37:53 -04:00
Oliver Gugger
06a693f10e
lnrpc+rpcserver: add new fully resolved chan update event
This commit adds the new channel update event for a channel that is now
fully resolved to the event subscription RPC.
2021-08-09 13:55:34 +02:00
Oliver Gugger
9138c8abac
multi: rename local and remote chan DBs
As a preparation to not have a local and remote version of the database
around anymore, we rename the variables into what their actual function
is. In case of the RPC server we even directly use the channel graph
instead of the DB instance. This should allow us to extract the channel
graph into its own, separate database (perhaps with better access
characteristics) in the future.
2021-08-04 14:55:50 +02:00
Oliver Gugger
dd749fe580
lnrpc: update grpc-gateway library to v2 2021-07-27 13:09:59 +02:00
Olaoluwa Osuntokun
6a97e6432d
Merge pull request #5419 from LN-Zap/upstream/fix-no-payment-address
lnd: only set payment address if not empty in PaymentRequest
2021-06-24 15:46:41 -07:00
Olaoluwa Osuntokun
1287328678
Merge pull request #5335 from guggero/abandonchannel-no-dev
RPC/CLI: Allow abandonchannel to be used in regular build
2021-06-23 16:05:34 -07:00
Bjarne Magnussen
4d0601c648
lnd: only set payment address if not empty in PaymentRequest 2021-06-22 11:18:29 +02:00