Commit Graph

891 Commits

Author SHA1 Message Date
yyforyongyu
0735522194
multi: fix make fmt 2022-08-23 22:10:24 +08:00
Elle Mouton
ca6a2e12e0
rpcserver+docs: add default case to addr type switch
This commit adds a default case to the address type switch statement in
the NewAddress rpc server function. This catches any invalid address
types and returns an error.
2022-08-22 17:25:56 +02:00
Olaoluwa Osuntokun
be5bc79444
Merge pull request #6716 from Crypt-iQ/zeroconfacceptor
multi: add zeroconfacceptor to default reject incoming channels
2022-08-12 14:20:11 -07:00
eugene
c2a4a9adbc
multi: add zeroconfacceptor that default rejects if no rpc acceptors
This is a safety mechanism so that zero-conf channels are not accepted
by default if no rpc acceptor exists.
2022-08-12 16:30:42 -04:00
Olaoluwa Osuntokun
bcff2f07de
rpc: use P2TR addresses when sending funds back to wallet (anchor reserve) 2022-08-11 17:26:18 -07:00
eugene
aa576adecc
rpc+cli: add general ListAliases function to dump all aliases 2022-08-09 14:11:08 -04:00
eugene
48f270fe20
rpc: add zero-conf, alias information to {list,closed}channels 2022-08-09 14:09:41 -04:00
Olaoluwa Osuntokun
1e556aa189
multi: thread through the new max fee field for co-op close
In this commit, we parse the new max fee field, and pass it through the
switch, all the way to the peer where it's ultimately passed into the
chan closer state machine.
2022-07-26 17:23:16 -07:00
Elle Mouton
25acb51ba3
multi: registration complete MW interceptor msg
In this commit, we change the flow of the rpc middleware registration
a bit. In order to allow a client to add rpc middleware interceptors in
a deterministic order, we now make the server send a "registration
complete" message to the client after compeleting the registration
process so that the client knows when it can go ahead and register the
next client.
2022-07-20 14:58:47 -05:00
eugene
49dd4b9e34
multi: add zero-conf, scid-alias channel-types to rpc
This allows the open channel rpcs to use the zero-conf or scid-alias
channel types.
2022-07-07 17:10:30 -04:00
eugene
0ba67015da
rpcserver+invoicesrpc: alias-aware AddInvoice,AddHoldInvoice rpc
AddInvoice,AddHoldInvoice now issue invoices that include our
peer's aliases. Some extra sanity checks are included to ensure we
don't leak our confirmed SCID for a private channel.
2022-07-07 17:10:29 -04:00
eugene
1aa9626606
server+funding: allow scid-alias, zero-conf chantypes, scid-alias
feature-bit channels

This allows opening zero-conf chan-type, scid-alias chan-type, and
scid-alias feature-bit channels. scid-alias chan-type channels are
required to be private. Two paths are available for opening a zero-conf
channel:

* explicit chan-type negotiation
* LDK carve-out where chan-types are not used, LND is on the
  receiving end, and a ChannelAcceptor is used to enable zero-conf

When a zero-conf channel is negotiated, the funding manager:
* sends a FundingLocked with an alias
* waits for a FundingLocked from the remote peer
* calls addToRouterGraph to persist the channel using our alias in
  the graph. The peer's alias is used to send them a ChannelUpdate.
* wait for six confirmations. If public, the alias edge in the
  graph is deleted and replaced (not atomically) with the confirmed
  edge. Our policy is also read-and-replaced, but the counterparty's
  policy won't exist until they send it to us.

When a scid-alias-feature channel is negotiated, the funding manager:
* sends a FundingLocked with an alias:
* calls addToRouterGraph, sends ChannelUpdate with the confirmed SCID
  since it exists.
* when six confirmations occurs, the edge is deleted and re-inserted
  since the peer may have sent us an alias ChannelUpdate that we are
  storing in the graph.

Since it is possible for a user to toggle the scid-alias-feature-bit
to on while channels exist in the funding manager, care has been taken
to ensure that an alias is ALWAYS sent in the funding_locked message
if this happens.
2022-07-07 17:10:28 -04:00
priyanshiiit
8578433b3d lnrpc+lnd: adds required reserve in walletbalance rpc 2022-06-28 23:31:51 +05:30
yyforyongyu
6b34ebbe44
rpcserver: fix wrong unit used in PushAmountSat 2022-05-16 05:49:05 +08:00
Olaoluwa Osuntokun
0ec88b5346
Merge pull request #6347 from yyforyongyu/5388-rm-revc-log
lnwallet+channeldb: store minimal info in revocation log bucket
2022-05-05 15:52:59 -07:00
Oliver Gugger
a44e56b51a
lnrpc: add new request/response fields for payment count 2022-05-02 12:32:06 +02:00
Joost Jager
caf11d2607
rpcserver: expose interceptor required flag on info call 2022-04-25 11:05:18 +02:00
Joost Jager
3ad9a42e65
rpcserver: remove unnecessary conversion 2022-04-25 11:05:04 +02:00
yyforyongyu
f42d1f2d62
multi: remove function BalancesAtHeight
This commit deletes the function `BalancesAtHeight` since its only
usague is to find the push amount, which can be achieved by saving the
initial balances.
Another reason to remove it is to pave the way to incooperate our new
revocation log. If we ever need this function again, we can add it back
by visiting all the revocation logs to calculate the balances at a given
height.
2022-04-20 01:18:13 +08:00
Joost Jager
9195f29e61
routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
Oliver Gugger
2a069b8b4e
rpcserver: copy success variable of channel close update
Seems this was forgotten in a refactor a while back.
2022-04-12 19:30:11 +02:00
positiveblue
e4e0935816
lnrpc/peers: skeleton logic for updateNodeAnnouncement
Basic logic for the endpoint:

- Get the current nodeAnn information
- Calculate modifications
- Apply modifications
- Return changes
2022-04-01 18:36:21 -07:00
Oliver Gugger
c73cf03a55
multi: add p2tr keyspend wallet support 2022-03-24 18:02:38 +01:00
Olaoluwa Osuntokun
4ecd153be2
lnrpc: add new locked balance field for WalletBalance
In this commit, we add a new field to the WalletBalance call that
permits users to account for the set of outputs that may be locked due
to a pending transaction. Without this field any time users locked
outputs for things like PSBT signing, then they disappear from the
WalletBalance call, which may cause a panic.
2022-03-17 16:36:44 -07:00
Olaoluwa Osuntokun
f13399bc49
Merge pull request #6190 from ErikEk/listunspent-deafult-values
walletrpc: add default values to listunspent
2022-03-16 16:16:45 -07:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
bitromortac
45a2dc80c8
autopilot: implement cached ChannelGraph
Using the cached implementation of a ChannelGraph greatly speeds up the
conversion of the channel database to a SimpleGraph.
2022-03-07 11:15:47 +01:00
bitromortac
52d56a8990
lnrpc+autopilot: add graph diameter calculation
* adds a brute force computation of the diameter
* adds a more efficient calculation of the diameter
2022-03-07 11:15:47 +01:00
ErikEk
74db83bbfb walletrpc: add default values to listunspent 2022-02-17 10:05:16 +01:00
Oliver Gugger
13f187046b
multi: fix issues reported by whitespace linter 2022-02-15 16:26:08 +01:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
ErikEk
ef1eff1058 lnrpc: fix the existing routing fee inaccuracy
When updating the channel routing policy, we encounter an inaccurate
precision error when calculating the routing fee. The issue stems from
the way the IEEE 754 standard works.

The solution here is to add a uint64 parameter (as mentioned in the
issue) and keep the float64 fee_rate parameter but rounding the product
of the base and fee rate.
2022-01-25 15:42:57 -08:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
mads krogh
1e3c05399c lnd+lnrpc: add private status to pendingchannels response 2022-01-18 09:42:14 +01:00
mads krogh
42cebcfe2b lnd: remove unused graph param from createRPCOpenChannel 2022-01-18 09:42:05 +01:00
yyforyongyu
99378b22c3
rpcserver: add closing txid in WaitingCloseChannel 2022-01-07 18:21:02 +08:00
yyforyongyu
3c1c640612
rpcserver: split PendingChannels into three sections
This commit refactors the method PendingChannels for maintenance
purpose.
2022-01-07 16:38:51 +08:00
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