funding: add fundmax flag to OpenChannelRequest (funding)
https://github.com/lightningnetwork/lnd/pull/6903
Host: Crypt-IQ -
Notes
- The majority of the code change is in the
lnwallet/chanfunding
package. The flow for opening channels at the code-level is, roughly,rpcserver.go
->funding/manager.go
->lnwallet
. User-specified parameters such as fundmax will reach thelnwallet
code through this path. - Check out the channel funding coin selection logic in
lnwallet/chanfunding/coin_select.go
- Consider checking out
itest/lnd_channel_funding_fund_max_test.go
to have a good overview of fundmax behavior.
Questions
Questions:
- Did you review the PR and, if so, what’s your overall verdict? (ACK, NACK, concept ACK, unknown, mega-NACK, tACK)
- Did you test the PR and, if so, how did you find the fundmax option?
- Could it use more documentation on the cli?
- Did anything break?
- What is the problem that fundmax is trying to solve?
- Why do we disallow setting
LocalFundingAmt
andFundMax
? - Why do we disallow setting a psbt with
FundMax
? - Why do we disable
fundmax
forCannedAssembler
andPsbtAssembler
? - In
lnwallet/chanfunding/coin_select.go
:- What does the
CoinSelect
function do? - What does the
CoinSelectSubtractFees
function do?- How does
CoinSelect
differ fromCoinSelectSubtractFees
?
- How does
- What does the
CoinSelectUpToAmount
function do?- How does
CoinSelectUpToAmount
differ from the previous two functions?
- How does
- What does the
- In
lnwallet/chanfunding/assembler.go
:- What role does
RemoteChanReserve
play in theRequest
struct? - What about
WalletReserve
?
- What role does