This commit is contained in:
George Tsagkarelis 2026-08-13 10:18:15 +00:00 committed by GitHub
commit 78a9287422
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 1 deletions

View file

@ -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,

View file

@ -42,6 +42,17 @@
configurable, generous timeout (`--lndreadytimeout`, defaulting to 10
minutes) instead of a fixed attempt count.
* [Fix a startup deadlock when tapd runs in integrated
mode](https://github.com/lightninglabs/lightning-terminal/pull/1371):
litd waited for lnd to be fully synced to chain before starting its
sub-servers, but lnd only reports itself as synced once its blockbeat has
caught up, and block processing can be blocked on tapd's aux sweeper, which
only becomes available once tapd is started. With a channel being resolved on
chain, litd therefore retried the lnd client creation forever and tapd never
came up. We now only wait for the chain notifier, and additionally require an
HTLC interceptor to be attached whenever tapd runs in-process, so lnd fails
forwards back instead of forwarding them without any RFQ policy checks.
### Functional Changes/Additions
* [Add accounts payments history subcommand](https://github.com/lightninglabs/lightning-terminal/pull/1316):
@ -117,4 +128,5 @@
* 0xfandom
* bitromortac
* Cyberguru1
* George Tsagkarelis
* Vandit Singh

View file

@ -1003,6 +1003,23 @@ func (g *LightningTerminal) setupFullLNDClient(ctx context.Context,
// so if we instruct the lndclient to wait for the wallet sync, we
// should be fully ready to start all our subservers. This will just
// block until lnd signals readiness.
//
// There is one exception to that: with both lnd and tapd running
// in-process, we must not wait for lnd to be synced to chain here. lnd
// only reports itself as synced once its blockbeat caught up, and block
// processing can be blocked on tapd's aux components. If for example a
// channel is being resolved on chain, the sweeper calls into tapd's aux
// sweeper, which blocks until tapd is started. As tapd is only started
// once we have the client below, waiting here would deadlock the
// startup and we'd retry forever without ever starting tapd.
integratedTapd := g.cfg.LndMode == ModeIntegrated &&
g.cfg.TaprootAssetsMode == ModeIntegrated
blockUntilChainSynced := !integratedTapd
if integratedTapd {
log.Infof("Not waiting for lnd to be synced to chain, as " +
"tapd is running in integrated mode")
}
log.Infof("Connecting full lnd client")
for {
g.lndClient, err = lndclient.NewLndServices(
@ -1020,7 +1037,7 @@ func (g *LightningTerminal) setupFullLNDClient(ctx context.Context,
RPCTimeout: g.cfg.LndRPCTimeout,
ChainSyncPollInterval: g.cfg.LndConnectInterval,
BlockUntilChainSynced: true,
BlockUntilChainSynced: blockUntilChainSynced,
BlockUntilUnlocked: true,
BlockUntilChainNotifier: true,
},