routing: add TODO to also delete payments without HTLCs
What changed, and why it matters
This commit only adds a code comment (a TODO note) suggesting a future cleanup for payments that were started but never had an actual payment attempt registered. It makes no code changes that fix or alter behavior, so it does not by itself address any active security issue.
No immediate action needed; treat as a future maintenance item. If investigating related issues, review how payments are initialized and whether unattempted payments can accumulate or cause startup problems.
Security signals we found
Comment-only change
Mentions orphaned/incomplete payment state (payment initialized but no HTLC attempt registered)
No functional patch or behavior change
Evidence from the diff
The diff inserts a TODO comment in routing/router.go inside resumePayments(), noting that startup cleanup should also consider payments with zero HTLCs because a payment can be initialized without an attempt being registered. No logic is modified; it is purely a developer reminder.
Changed components
routing/router.goresumePayments()Inspect captured patch +5 / −0
diff --git a/routing/router.go b/routing/router.go
index c0bc15c..c17aa41 100644
--- a/routing/router.go
+++ b/routing/router.go
@@ -1439,6 +1439,11 @@ func (r *ChannelRouter) resumePayments() error {
log.Debugf("Scanning finished, found %d inflight payments",
len(payments))
+ // TODO(ziggie): Also check for payments which have no HTLCs at all
+ // this can happen because we register an attempt after initializing the
+ // payment, so there is a small chance that we init a payment but never
+ // register an attempt for it.
+
// Before we restart existing payments and start accepting more
// payments to be made, we clean the network result store of the
// Switch. We do this here at startup to ensure no more payments can be
Why this scored 3/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.