Commit Graph

907 Commits

Author SHA1 Message Date
Oliver Gugger
625c6f1949
Merge pull request #7227 from Crypt-iQ/tlv_change_to_p2p
multi: update to tlv/v1.1.0 and use new *P2P tlv decoding variants
2022-12-05 23:11:30 +01:00
eugene
032632b4e0
multi: update to tlv/v1.1.0 and use new *P2P tlv decoding variants
This changes the call-sites in several places to use the *P2P variants
to not trigger an OOM on untrusted input. This makes the code safe with
the new tlv version. Note that the call-sites prior to this change were
also safe.
2022-12-05 09:32:56 -05:00
yyforyongyu
e9269c2093
channeldb+lnd: rpc server filters payments by date 2022-12-05 20:04:47 +08:00
yyforyongyu
234b9a3d97
channeldb+lnd: rpc server filters invoices by date 2022-12-05 20:03:58 +08:00
Oliver Gugger
ad8e25cbc9
multi: don't access loop variables in goroutines
This commit makes sure that no loop variables or other temporary
variables are accessed directly in a goroutine but are instead passed
into the goroutine through a parameter. This makes sure a copy of the
value is put on the stack and is not changed while the outside loop
continues.
2022-11-21 13:54:23 +01:00
st4rgut24
8d6d1564c0 cli: revise help text for addinvoice lncli command [skip ci] 2022-11-11 14:31:04 -08:00
Joost Jager
3a89a84744
rpcserver: add LookupHtlc call 2022-10-27 16:43:09 +02:00
Slyghtning
46b8de35ac lnrpc+lncli: rename skip_peer_alias_lookup to reflect opt-in behavior 2022-10-27 07:11:19 -04:00
yyforyongyu
3b250b294c
rpcserver+lntemp: add more error logs to PendingChannels
This commit adds error logs to `PendingChannels` and changes how we
assert the num of pending force close channels, see the docs for more
info.
2022-10-27 01:11:33 +08:00
Joost Jager
6e073cb213
rpcserver: expose graph tlv data 2022-10-25 18:17:35 +02:00
Joost Jager
0663a92bff
rpcserver: extract marshalNode 2022-10-25 18:17:34 +02:00
Joost Jager
01e7f09dfb
rpcserver: extract marshalDBRoutingPolicy 2022-10-25 15:24:48 +02:00
Slyghtning
3e4c98c938 rpcserver: enrich ForwardingHistory with peer alias
In this commit a helper method in ForwardingHistory is introduced that enriches
each ForwardingEvent by peer alias names for the incoming and outgoing channel.
2022-10-20 09:23:47 -04:00
Roei Erez
b6a24b52fe
lnrpc+rpcserver: add remote reserve to openchannel request 2022-10-07 14:57:05 +02:00
Slyghtning
1e030c2d48 rpcserver: parse channel fees into InitFundingMsg 2022-09-29 08:21:09 -04:00
Elle Mouton
081546ee00
rpcserver: error on zero local balance in openchan req
In this commit, we catch and error on the specific case where an
openchannel request has a zero-value local funding amount. This is just
to ensure that the error message returned makes more sense.
2022-09-26 13:29:28 +02:00
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