From 3cb07bb6035ed6ff8dfbe2e3be9a26a2b87d6a3b Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Mon, 10 Aug 2026 16:01:17 +0000 Subject: [PATCH] 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. --- config.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.go b/config.go index a8393d96..77045a8c 100644 --- a/config.go +++ b/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,