AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 22 Bitcoin

tor: skip onion cleanup before service creation

Public commit record

What the developer wrote

Authored by Boris Nagaev

68/100 · Adequate
tor: skip onion cleanup before service creation

Only send DEL_ONION if ADD_ONION completed successfully and the
controller has an active service ID to remove.

This avoids masking the original ADD_ONION failure with a secondary
empty DEL_ONION error during startup cleanup.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in how LND's Tor controller shuts down. Previously, during startup cleanup, the controller would try to delete an onion service that might never have been created, which could hide the real reason why creating the onion service failed. The fix only deletes the onion service if it was actually created, and makes shutdown more robust by always closing the Tor control connection and reporting both cleanup errors clearly.

Recommended action

Review and merge. The change is defensive and improves diagnostics and cleanup reliability. No immediate security patch urgency, but it removes a failure-mode that could complicate incident response.

Security signals we found

01

Error-handling improvement that prevents masking of original ADD_ONION failures

02

Ensures control connection is closed even when DEL_ONION fails

03

Prevents stopped flag from being consumed when no connection exists

04

Preserves diagnostic state (activeServiceID) when both cleanup paths fail

Risk score

Why this scored 22/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 3/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.