Commit Graph

932 Commits

Author SHA1 Message Date
cf1f44ab10 Merge pull request #7689 from guggero/housekeeping
Housekeeping (fix small issues, take over stale contributor PRs)
2023-06-13 17:42:53 +02:00
681e3ceede rpc: verify address is for correct net
Verify that the addresses we're decoding when sending coins onchain are
for the correct network. Without this check we'll convert the users
addresses to their equivalent on other networks, which is a gross
violation of the principle of least astonishment.
2023-06-13 11:58:34 +02:00
56dba2df03 multi: update linter, fix new issues 2023-06-13 11:58:33 +02:00
663b28808a funding: provide FundingExpiryBlock field in PendingOpenChannel message. 2023-06-12 10:04:04 -07:00
f9d4600ff8 Merge pull request #7645 from shaurya947/bitcoind-minmempoolfee
sweep+lnrpc: enforce provided fee rate is no less than relay fee
2023-05-30 13:15:22 +02:00
85ab96cd09 lnrpc: move CalculateFeeRate from rpcserver.go to rpc_utils.go
This refactor aims to house the CalculateFeeRate function in a more
"shareable" location. It used to be a non-exported function inside
of rpcserver.go. However, other routines, such as FundPsbt inside
of walletkit_server.go, could also rely on the same fee calculation
functionality. So we move the function to rpc_utils.go and export it,
and we will reuse it in the FundPsbt workflow in a future PR.
2023-05-26 11:16:51 -04:00
c8e4d8e69b rpcserver: attach channel Memo to *lnrpc.Channel struct
This allows us the memo to be returned in responses such as
listchannels.
2023-05-18 13:02:30 -04:00
7c6faa4c98 funding: add Memo to InitFundingMsg struct
We add byte-array field called Memo to the InitFundingMsg struct.
We also provide a value for this from
rpcserver.go#parseOpenChannelReq().
2023-05-18 13:02:30 -04:00
1724409647 rpcserver: enforce memo length is less than 500 characters
In this commit we ensure that the string length of the memo field
specified as part of the OpenChannelRequest is no longer than 500.
2023-05-18 13:02:24 -04:00
8df4edef1b Merge pull request #7624 from ellemouton/marshalBytesAndStringTxid
multi: populate both string and byte TXID in lnrpc.Outpoint
2023-05-08 17:32:54 +02:00
3f9f0ea5d1 multi/refactor: separate methods for get and set node announcement
In preparation for a more complex function signature for set node
announcement, separate get and set so that readonly callers don't need
to handle the extra arguments.
2023-05-04 10:35:42 -04:00
7b186716a1 multi: populate both string and byte TXID in lnrpc.Outpoint
This commit adds a a new `MarshalOutPoint` helper in the `lnrpc` package
that can be used to convert a `wire.Outpoint` to an `lnrpc.Outpoint`.
By using this helper, we are less likely to forget to populate both the
string and byte form of the TXID.
2023-04-24 16:19:26 +02:00
0e5b3e77cb lnd: handles the FundMax field inside parseOpenChannelReq
Adds handling of the `FundMax` field when parsing an
`OpenChannelRequest` with `rpcServer.parseOpenChannelReq`.
2023-04-05 23:05:07 +02:00
41016587eb Add peer_scid_alias field to lnrpc.Channel 2023-03-31 11:20:27 -04:00
cbcbddfe29 rpcserver: add time_lock_delta overflow check 2023-03-23 21:34:12 +08:00
9bd0dcd121 rpcserver: add debug log for rpc calls 2023-03-17 10:01:42 +08:00
213bdb2e01 rpcserver: assign peer alias lookup error 2023-03-03 10:07:44 +01:00
c26917ee1f multi: rename LookupHtlc to LookupHtlcResolution for clarity 2023-03-01 01:47:08 +08:00
38d0ee9291 lnd: don't allow lookup when StoreFinalHtlcResolutions is false 2023-02-27 16:59:16 +08:00
3e5943b7f9 rpcserver: enrich ListChannels with peer alias 2023-02-24 10:49:11 +01:00
784c0631f3 rpcserver: expose store final htlc resolutions flag on info call
The storage of final htlc resolutions is a safety-critical feature. By
exposing it through the GetInfo call, connected applications can
ensure that the feature is turned on and avoid relying on the assumption
that lnd was configured correctly.
2023-02-13 11:53:27 +01:00
db5dc4d360 rpcserver: fix line lengths 2023-02-13 11:53:10 +01:00
ced8833895 channelnotifier: add InactiveLinkEvent
This commit adds a new event `InactiveLinkEvent` to be used when a link
becomes inactive.
2023-01-18 03:46:16 +08:00
5ff5225245 multi: break invoice depenency on channeldb
Now that we have the new package `lnd/channeldb/models` we can invert the
depenency between `channeldb` and `invoices`.

- Move all the invoice related types and errors to the
`invoices` package.

- Ensure that all the packages dealing with invoices use the types and
  interfaces defined in the `invoices` package.

- Implement the InvoiceDB interface (defined in `lnd/invoices`) in
  channeldb.

- Add new mock for InterfaceDB.

- `InvoiceRegistery` tests are now in its own subpacakge (they need to
  import both invoices & channeldb). This is temporary until we can
  decouple them.
2023-01-16 07:31:09 -08:00
454c115b6e routing+routerrpc: add capacity in rpcs
FetchPairCapacity is used by the following endpoints to introduce the
capacity for probability calculations:

* QueryProbability
* QueryRoutes
2022-12-12 13:22:29 +01:00
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
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
e9269c2093 channeldb+lnd: rpc server filters payments by date 2022-12-05 20:04:47 +08:00
234b9a3d97 channeldb+lnd: rpc server filters invoices by date 2022-12-05 20:03:58 +08:00
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
8d6d1564c0 cli: revise help text for addinvoice lncli command [skip ci] 2022-11-11 14:31:04 -08:00
3a89a84744 rpcserver: add LookupHtlc call 2022-10-27 16:43:09 +02:00
46b8de35ac lnrpc+lncli: rename skip_peer_alias_lookup to reflect opt-in behavior 2022-10-27 07:11:19 -04:00
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
6e073cb213 rpcserver: expose graph tlv data 2022-10-25 18:17:35 +02:00
0663a92bff rpcserver: extract marshalNode 2022-10-25 18:17:34 +02:00
01e7f09dfb rpcserver: extract marshalDBRoutingPolicy 2022-10-25 15:24:48 +02:00
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
b6a24b52fe lnrpc+rpcserver: add remote reserve to openchannel request 2022-10-07 14:57:05 +02:00
1e030c2d48 rpcserver: parse channel fees into InitFundingMsg 2022-09-29 08:21:09 -04:00
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
0735522194 multi: fix make fmt 2022-08-23 22:10:24 +08:00
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
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
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
bcff2f07de rpc: use P2TR addresses when sending funds back to wallet (anchor reserve) 2022-08-11 17:26:18 -07:00
aa576adecc rpc+cli: add general ListAliases function to dump all aliases 2022-08-09 14:11:08 -04:00
48f270fe20 rpc: add zero-conf, alias information to {list,closed}channels 2022-08-09 14:09:41 -04:00
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
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