Commit Graph

956 Commits

Author SHA1 Message Date
a44bf381c4 multi: move AddTower to Tower Client Manager
In this commit we move the AddTower method from the Client interface to
the TowerClientManager interface. The wtclientrpc is updated to call the
`AddTower` method of the Manager instead of calling the `AddTower`
method of each individual client. The TowerClient now is also only
concerned with adding a new tower (or new tower address) to its
in-memory state; the tower Manager will handle adding the tower to the
DB.
2023-11-28 09:54:02 +02:00
0e82293e45 multi: address linter issues 2023-11-08 14:50:35 +02:00
84cdcd6847 multi: move DB schemas to channeldb/models
This commit moves the ChannelEdgePolicy, ChannelEdgeInfo,
ChanelAuthProof and CachedEdgePolicy structs to the `channeldb/models`
package.
2023-11-08 14:50:35 +02:00
6c76d31e89 multi: let FetchLightningNode take an optional tx
In preparation for the next commit which will remove the
`*LightningNode` from the `ChannelEdgePolicy` struct,
`FetchLightningNode` is modified to take in an optional transaction so
that it can be utilised in places where a transaction exists.
2023-11-08 14:50:34 +02:00
fa7c1e250b multi: let ForEachChannel be a method on ChannelGraph
Having a `ForEachChannel` method on the `LightningNode` struct itself
results in a `kvdb.Backend` object needing to be stored within the
LightningNode struct. In this commit, this method is replaced with a
`ForEachNodeChannel` method on the `ChannelGraph` struct will perform
the same function without needing the db pointer to be stored within the
LightningNode. This change, the LightningNode struct more closely
represents the schema on disk.

The existing `ForEachNodeChannel` method on `ChannelGraph` is renamed to
`ForEachNodeDirectedChannel`. It performs a slightly different function
since it's call-back operates on Cached policies.
2023-11-08 10:51:50 +02:00
0532b82dd5 multi: add new method FeePerVByte to avoid manual conversion 2023-10-13 17:00:53 +08:00
ad5cd9c8bb multi: extend InvoiceDB methods with a context argument (#8066)
* multi: extend InvoiceDB methods with a context argument

This commit adds a context to InvoiceDB's methods. Along this refactor
we also extend InvoiceRegistry methods with contexts where it makes
sense. This change is essential to be able to provide kvdb and sqldb
implementations for InvoiceDB.

* channeldb: restrict invoice tests to only use an InvoiceDB instance

* docs: update release notes for 0.18.0
2023-10-11 13:42:59 +02:00
25d82fd62b rpcserver+sweep: fix linter re unused params 2023-10-06 16:34:47 -07:00
24fa35ec80 multi: make sure CPFP won't exceed max allowed fee rate
This commit updates the `fee()` method in `weightEstimator` to make sure
when doing CPFP we are not exceeding the max allowed fee rate. In order
to use the max fee rate, we need to modify several methods to pass the
configured value to the estimator.
2023-10-06 16:34:47 -07:00
031dbd7760 multi: remove ChainRegistry 2023-10-06 16:34:47 -07:00
3912d5a0c6 multi: remove Litecoin config options
This commit removes the `Litecoin`, `LtcMode` and `LitecoindMode`
members from the main LND `Config` struct. Since only the bitcoin
blockchain is now supported, this commit also deprecates the
`cfg.Bitcoin.Active` config option.
2023-10-06 16:34:47 -07:00
bb7a257359 Merge pull request #8037 from yyforyongyu/fix-weight-calc
lnwallet+rpcserver: fix weight calculation for taproot channels
2023-09-28 11:21:29 -05:00
522518922f lnwallet+rpcserver: fix weight calculation for taproot channels 2023-09-28 19:42:13 +08:00
d94ae3f509 lnrpc+rpcserver: add musig2 to ChanPointShim 2023-09-26 21:45:17 +02:00
384b1b1c12 feature: use +100 staging bit for taproot channels
In this commit, we carry out a new notion introduced during a recent
spec meeting to use a feature bit plus 100 before the feature has been
finalized in the spec.

We split into the Final and Staging bits.
2023-08-22 16:34:28 -07:00
4aa9bba4ef rpc: update open channel parsing to detect taproot chans 2023-08-22 16:32:31 -07:00
95d627af4e lnwallet/chanfunding: update assemblers to support musig2
In this commit, we update the set of intents and assemblers to recognize
musig2. For this change, we use a new bool, `musig2`, then use that to
determine if we need to use the new taproot funding scripts or not.
2023-08-22 16:30:42 -07:00
ab117a0ed4 typos: fix updatechanpolicy typos 2023-08-11 17:04:36 +02:00
d930dcec40 Merge pull request #7819 from ziggie1984/abandonchannel-rebroadcaster
Cancel the Rebroadcasting of a Transaction when Abandoning a Channel
2023-08-10 10:43:24 +02:00
b9560b067a refactor: move State server REST registration
This commit moves the registration of the State server with a REST proxy
into the `RegisterWithRestProxy` method in order to keep all the REST
registrations in one place.
2023-08-08 11:43:25 +02:00
dd912911fa lnd: cancel rebroadcasting a tx.
When abandoning a channel we make sure we cancel the rebroadcasting
of the transaction.
2023-08-08 09:31:17 +02:00
dd2a89a6ee lnd: WalletBalance checks on account basis 2023-07-28 22:24:55 +02:00
e4f0e58214 lnd: handles selected outpoints in parseOpenChannelReq 2023-07-24 13:06:59 +02:00
44fdd02ab4 lnrpc+itest: return channel Memo for Pending channels
In a previous PR we added a Memo field for channels that could be
specified when opening a channel. This was a reference note-to-self
with no bearing on the functioning of the channel. In that PR, the
memo value was returned only through ListChannels. This commit builds
upon that PR by also returning the Memo field for channels returned by
PendingChannels RPC.
2023-06-15 15:16:06 -04:00
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