Commit Graph

1679 Commits

Author SHA1 Message Date
Ononiwu Maureen
99339f706f
multi: expand SendOutputs and CreateSimpleTx to take utxos
This commit updates the interface methods from
`lnwallet.WalletController` to take optional input set which can be used
to create the tx.
2024-08-07 20:42:27 +08:00
Oliver Gugger
75ec6da177
Merge pull request #8979 from ProofOfKeags/refactor/useless-args
[NANO]: Remove useless appendages from lnwallet/channel.go
2024-08-07 01:37:56 -06:00
Keagan McClelland
c3c4e79593
lnwallet: update updateLog.modifiedHtlcs to use fn.Set 2024-08-06 10:05:20 -07:00
Keagan McClelland
935e7f1bee
lnwallet: remove unused parameters in LightningChannel methods 2024-08-05 18:14:11 -07:00
Keagan McClelland
14e371948b
lnwallet: remove unnecessary duplicate definition 2024-08-05 18:14:11 -07:00
Olaoluwa Osuntokun
c262b1b5a5
Merge pull request #8968 from ProofOfKeags/opening-party
[MICRO]: channeldb+lnwallet: add OpeningParty API
2024-08-05 16:42:22 -07:00
Keagan McClelland
a2b19afe59
channeldb+lnwallet: define Initiator for OpenChannel and LightningChannel
This commit introduces a new API to return information on which party opened
the channel using the new ChannelParty type. It does not change the underlying
structure of how we store this information.
2024-08-05 12:58:46 -07:00
Oliver Gugger
11c7e20d0a
Merge pull request #8953 from ProofOfKeags/refactor/lnwallet-channel-channel-constraints-partition
[MICRO]: multi: break ChannelConstraints into two sub-structures
2024-08-05 02:08:52 -06:00
Oliver Gugger
6e63dcd6f9
Merge pull request #8952 from ProofOfKeags/refactor/lnwallet-channel-typed-list
[MICRO]: lnwallet: refactor channel to use new typed List
2024-08-05 02:07:50 -06:00
Olaoluwa Osuntokun
4a3c4e4ba7
Merge pull request #8497 from ziggie1984/shutdown-bugfix
routing: shutdown chanrouter correctly.
2024-08-01 16:48:50 -07:00
Keagan McClelland
e3a9d0acbe
multi: break ChannelConstraints into two sub-structures
This commit breaks the ChannelConstraints structure into two
sub-structures that reflect the fundamental differences in how
these parameters are used. On its face it may not seem necessary,
however the distinction introduced here is relevant for how we
will be implementing the Dynamic Commitments proposal.
2024-08-01 12:00:32 -07:00
Keagan McClelland
0996e4f163
multi: refactor lnwallet/channel.go to use ChannelParty in select places
We also include changes to contractcourt, htlcswitch and peer to stitch the
boundaries together.
2024-07-31 14:50:26 -07:00
Keagan McClelland
33934449ac
multi: refactor select methods within channeldb to use ChannelParty
Also in this commit is a small adjustment to the call-sites to get
the boundaries stitched back together.
2024-07-31 14:50:26 -07:00
Keagan McClelland
3a15085014
input+lnwallet: refactor select methods in input to use ChannelParty 2024-07-31 14:50:26 -07:00
Keagan McClelland
04c37344ae
lnwallet: refactor channel to use new typed List 2024-07-31 13:03:34 -07:00
Oliver Gugger
72a36da9c6
Merge pull request #8950 from ProofOfKeags/refactor/lnwallet-channel-move-only
[NANO]: Move definitions into their own file
2024-07-31 06:53:19 -06:00
ziggie
02c1264c53
multi: prevent nil panics in stop methods.
With this PR we might call the stop method even when the start
method of a subsystem did not successfully finish therefore we
need to make sure we guard the stop methods for potential panics
if some variables are not initialized in the contructors of the
subsystems.
2024-07-31 14:43:34 +02:00
Keagan McClelland
82ff360ad2
lnwallet: fix linter errors resulting from commitmentChain move. 2024-07-30 10:22:23 -07:00
Keagan McClelland
4cf7555922
lnwallet: move commitChain to its own file. 2024-07-30 10:18:28 -07:00
Keagan McClelland
3e7866d85c
lnwallet: fix linter errors introduced by updateLog move 2024-07-30 10:17:47 -07:00
Keagan McClelland
51060aed45
lnwallet: move updateLog to its own file. 2024-07-29 15:26:35 -07:00
Keagan McClelland
39db0221f0
lnwallet: move PaymentDescriptor definition to its own file 2024-07-29 15:26:35 -07:00
Eugene Siegel
d6001d033b
htlcswitch+lnwallet: calculate fee exposure as commit fees + dust
This commit expands the definition of the dust limit to take into
account commitment fees as well as dust HTLCs. The dust limit is now
known as a fee exposure threshold. Dust HTLCs are fees anyways so it
makes sense to account for commitment fees as well. The link has
been modified slightly to calculate dust. In the future, the switch
dust calculations can be removed.
2024-07-29 14:13:21 -04:00
yyforyongyu
d992cf94d6
multi: add SpewLogClosure to avoid code repetition 2024-07-25 22:18:49 +08:00
yyforyongyu
b6049ff94b
multi: add NewLogClosure in lnutils to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
2024-07-25 21:25:23 +08:00
yyforyongyu
7e60d41898
chainfee: make sure web API has been started before estimating
Previously we may get a floor feerate when calling `EstimateFeePerKW`
due to the fee estimator not finishing its startup process, which gives
us an empty fee map.

This is now fixed to return an error if the estimator is not started.
2024-07-24 20:05:00 +08:00
yyforyongyu
ce43e4bab7
chainfee: allow specifying min relay feerate from API source
This commit adds a new expected field, `min_relay_feerate`, in the
response body returned from the API source, allowing the API to specify
a min relay feerate to be used instead of the FeePerKwFloor.

This change is backwards compatible as for an old API source which
doesn't specify the `min_relay_feerate`, it will be interpreted as zero.
2024-07-24 20:05:00 +08:00
yyforyongyu
8f4bcd0b3a
lnwallet: fix ErrDoubleSpend 2024-07-06 13:59:28 +08:00
yyforyongyu
ddf46f435c
multi: update RPC error import path
These errors are now defined in `btcwallet/chain` instead of
`btcd/rpcclient`.
2024-07-06 13:59:28 +08:00
yyforyongyu
e0a506ab26
multi: use chain.MapRPCErr instead of rpcclient.MapRPCErr 2024-07-06 13:59:25 +08:00
zoupingshi
30047feb35 chore: fix some comments
Signed-off-by: zoupingshi <hellocatty@tom.com>
2024-05-31 15:16:33 +08:00
yyforyongyu
17a089c899
input+lnwallet: apply the new type lntypes.VByte 2024-05-25 13:37:16 +08:00
yyforyongyu
8da68bb7db
multi: apply the new type lntypes.WeightUnit 2024-05-25 13:37:13 +08:00
yyforyongyu
634967c5c8
chainfee: add FeeForVByte on SatPerKWeight 2024-05-24 22:49:20 +08:00
Tom Kirkpatrick
3837c3f12e
lnwallet: add configurable cache for web fee estimator
Add fee.min-update-timeout and fee.max-update-timeout config options to
allow configuration of the web fee estimator cache.
2024-05-04 14:41:41 +08:00
erik
ab83343c87 multi: repleace ioutil.ReadFile 2024-04-25 11:22:43 +02:00
ziggie
351e9a68dd
multi: Add tests to psbt and normal open channel flow.
Itests were added to the normal channel funding flow and the psbt
funding flow using unstable (unconfirmed sweeper inputs).
2024-04-24 13:58:20 +01:00
ziggie
ab7634b276
multi: Add utxo restriction for batchchannel openings.
Add utxo restrictions for psbt internal wallet funded lightning
channels. This also includes batchopening channels backed by the
internal wallet.
2024-04-24 13:58:20 +01:00
ziggie
62a52b4d7c
multi: Utxo restriction single funding case.
Restrict the utxo selection when opening a single internal wallet
funded backed channel.
2024-04-24 13:58:19 +01:00
yyforyongyu
0fc5301d12
lnwallet+sweep: cap conf target used in fee estimator 2024-04-19 21:33:31 +08:00
yyforyongyu
ecd471ac75
lnwallet+sweep: calculate max allowed feerate on BumpResult
This commit adds the method `MaxFeeRateAllowed` to calculate the max fee
rate. The caller may specify a large MaxFeeRate value, which cannot be
cover by the budget. In that case, we default to use the max feerate
calculated using `budget/weight`.
2024-04-19 21:33:29 +08:00
yyforyongyu
f85661d94a
lnwallet+sweep: add new method CheckMempoolAcceptance 2024-04-19 21:33:28 +08:00
yyforyongyu
6ff6c86155
multi: merge DetermineFeePerKw and Estimate
This commit moves `DetermineFeePerKw` into the `Estimate` method on
`FeePreference`. A few callsites previously calling `DetermineFeePerKw`
without the max fee rate is now also temporarily fixed by forcing them
to use `Estimate` with the default sweeper max fee rate.
2024-04-19 21:33:21 +08:00
Oliver Gugger
648fb22f63
multi: wrap all errors 2024-04-11 15:04:03 +02:00
Carla Kirk-Cohen
7fd9c2a7f8
multi: use some record for payment descriptor blinding point 2024-04-02 15:44:05 -04:00
Mohamed Awnallah
1a2d50d385
multi: add coin selection strategy option to all on-chain rpcs
In this commit, we add the coin selection strategy option to the following
on-chain RPCs `fundpsbt`, `batchopenchannel`, `estimatefee`, `sendcoins`,
`sendmany`, and `sendoutputs`.
2024-04-01 19:08:22 +02:00
Carla Kirk-Cohen
f090a64142
multi: add blinding point to payment descriptor and persist
This commit adds an optional blinding point to payment descriptors and
persists them in our HTLC's extra data. A get/set pattern is used to
populate the ExtraData on our disk representation of the HTLC so that
callers do not need to worry about the underlying storage detail.
2024-03-27 09:38:56 -04:00
Carla Kirk-Cohen
e4f90ec593
lnwire: add blinding point to update_add_htlc TLVs
Add blinding points to update_add_htlc. This TLV will be set for
nodes that are relaying payments in blinded routes that are _not_
the introduction node.
2024-03-27 09:38:50 -04:00
Oliver Gugger
1422df27b2
Merge pull request #8521 from zhiqiangxu/typo
chore: fix typo
2024-03-22 01:34:57 -06:00
zhiqiangxu
74a290b46d lnwallet+input: fix a few typoes 2024-03-21 15:44:45 +08:00