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

paymentsdb: add AMP hash regression test

Public commit record

What the developer wrote

Authored by yyforyongyu

90/100 · Strong
paymentsdb: add AMP hash regression test

SQL writes store the payment identifier in payment_hash for each
attempt. That is wrong for AMP payments, because the payment
identifier is the SetID while each shard carries its own HTLC hash.

Add TestRegisterAttemptPreservesAttemptHash as evidence. It passes on
KV and fails on SQL before the fix because SQL reads the attempt hash
back as the payment identifier.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit only adds a new regression test for the Lightning Network Daemon (LND) payments database. The test checks that for AMP (Atomic Multi-Path) payments, each individual payment attempt keeps its own unique hash rather than being overwritten by the overall payment identifier. The commit message says the test fails on the SQL database backend before a separate fix, but the actual code fix is not included in this commit. So by itself, this change does not fix anything; it only provides a test that demonstrates the bug.

Recommended action

Treat this commit as test-only. Locate the companion commit that changes the SQL persistence logic so the attempt hash is stored correctly, and review that fix for security impact. Do not rely on this commit alone to resolve any issue.

Security signals we found

01

Data-integrity bug in payment attempt hash storage for AMP payments

02

Regression test added, not the actual fix

03

Potential mismatch between stored HTLC hash and actual attempt hash in SQL backend

Risk score

Why this scored 41/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 7/15
Confidence 6/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.