Update — the second half of the recommendation fails too, and this one is fixable.
t-bast's line has two parts: refuse below 6, and let operators configure higher. I'd only checked the first. So I went back for the second.
There is an override in peer/brontide.go:
numConfs := p.cfg.ChannelCloseConfs.UnwrapOrFunc(func() uint32 {
// No override, use normal capacity-based scaling.
return lnwallet.CloseConfsForCapacity(chanCapacity)
})
It's fed by s.cfg.Dev.ChannelCloseConfs(). Under //go:build !integration — every release binary — lncfg/dev.go makes DevConfig an empty struct and returns fn.None[uint32]() unconditionally. The --force-channel-close-confs flag that would populate it exists only in lncfg/dev_integration.go, behind //go:build integration.
So on a production build the override is unreachable and your close depth is always exactly CloseConfsForCapacity(capacity). There is no supported way for an lnd operator to wait longer than 3 blocks on a sub-0.11 BTC channel.
One trap if you go looking for the knob: --coop-close-target-confs is in the flag list and sounds right. It's a fee-estimation target for close negotiation. It does nothing for reorg safety.
I've filed it upstream — https://github.com/lightningnetwork/lnd/issues/11072 — proposing an operator-facing option clamped to max(requested, CloseConfsForCapacity(capacity)) so it can only raise the count, never lower it. The plumbing exists end to end already; it's mostly moving the field out from behind the build tag. Offered to write the PR if a maintainer agrees on the interface.
Corrections still very welcome. This is all build tags and integer division, both of which are easy to get confidently wrong.
Update — the second half of the recommendation fails too, and this one is fixable.
t-bast's line has two parts: refuse below 6, and let operators configure higher. I'd only checked the first. So I went back for the second.
There is an override in
peer/brontide.go:numConfs := p.cfg.ChannelCloseConfs.UnwrapOrFunc(func() uint32 { // No override, use normal capacity-based scaling. return lnwallet.CloseConfsForCapacity(chanCapacity) })It's fed by
s.cfg.Dev.ChannelCloseConfs(). Under//go:build !integration— every release binary —lncfg/dev.gomakesDevConfigan empty struct and returnsfn.None[uint32]()unconditionally. The--force-channel-close-confsflag that would populate it exists only inlncfg/dev_integration.go, behind//go:build integration.So on a production build the override is unreachable and your close depth is always exactly
CloseConfsForCapacity(capacity). There is no supported way for an lnd operator to wait longer than 3 blocks on a sub-0.11 BTC channel.One trap if you go looking for the knob:
--coop-close-target-confsis in the flag list and sounds right. It's a fee-estimation target for close negotiation. It does nothing for reorg safety.I've filed it upstream — https://github.com/lightningnetwork/lnd/issues/11072 — proposing an operator-facing option clamped to
max(requested, CloseConfsForCapacity(capacity))so it can only raise the count, never lower it. The plumbing exists end to end already; it's mostly moving the field out from behind the build tag. Offered to write the PR if a maintainer agrees on the interface.Corrections still very welcome. This is all build tags and integer division, both of which are easy to get confidently wrong.