mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
config: require an HTLC interceptor when tapd is integrated
tapd's RFQ subsystem enforces the agreed upon quote for asset HTLCs through lnd's HTLC interceptor. Whenever no interceptor is attached, lnd forwards HTLCs without any of those checks. That window is small but real: it exists while tapd is starting up, and whenever tapd has to re-establish its interception stream. By setting lnd's requireinterceptor option whenever tapd runs in-process we make lnd fail forwards back with a temporary channel failure instead of forwarding them unchecked. HTLCs we receive ourselves are unaffected, as those are resolved through the invoice registry and never reach the forwarding interceptor.
This commit is contained in:
parent
a5bf9999b8
commit
3cb07bb603
1 changed files with 12 additions and 0 deletions
12
config.go
12
config.go
|
|
@ -1012,6 +1012,18 @@ func loadConfigFile(preCfg *Config, interceptor signal.Interceptor) (*Config,
|
|||
cfg.Lnd.ProtocolOptions.CustomMessage, lnwire.MsgError,
|
||||
)
|
||||
|
||||
// tapd's RFQ subsystem enforces the agreed upon quote for asset
|
||||
// HTLCs through lnd's HTLC interceptor. Whenever no interceptor
|
||||
// is attached, lnd forwards HTLCs without any of those checks,
|
||||
// which would allow asset HTLCs to be forwarded while tapd is
|
||||
// starting up or while it is re-establishing its interception
|
||||
// stream. We therefore require an interceptor to be present
|
||||
// whenever tapd runs in-process, which makes lnd fail HTLCs
|
||||
// back instead of forwarding them unchecked.
|
||||
if cfg.TaprootAssetsMode == ModeIntegrated {
|
||||
cfg.Lnd.RequireInterceptor = true
|
||||
}
|
||||
|
||||
var err error
|
||||
cfg.Lnd, err = lnd.ValidateConfig(
|
||||
*cfg.Lnd, interceptor, fileParser, flagParser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue