LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

1399 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

142security candidates195second-pass queue1287AI analyses
86commits · 30 days
186commits · 60 days
609commits · 180 days
1240commits · 365 days
Backfill bands
Aug 5 → Feb 6405 seen5 candidatesComplete
Feb 6 → Jun 6665 seen28 candidatesComplete
Jun 6 → Jul 689 seen4 candidatesComplete
Jul 6 → Aug 569 seen0 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

67/100 average clarity
322Strong · 80–100
655Adequate · 60–79
391Thin · 40–59
31Opaque · 0–39
1security candidate with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Olaoluwa Osuntokun20942204474
Elle Mouton26832268167
ziggie44416413165
Yong28513171
LNBiG111173
Jared Tobin909171
bitromortac661153071
yyforyongyu83861068
Erick Cestari26726070
Andras Banki-Horvath11311072
Gijs van Dam33230073
ziggieXXX2026070
Analysis record

Published AI watches

Last scanned 17 minutes ago

Moderate 62 AI analysisMessage 58 · Thin
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11212 from ziggie1984/disable-legacy-channels

This change stops LND from opening new Lightning channels using the old 'legacy' commitment format. The legacy format makes it harder to recover funds if something goes wrong, because the money owed to you is tied to a secret key that chan…

Prevents opening new channels with the legacy commitment type, whose tweaked to_remote output complicates data-loss recoveryCloses a negotiation path where an empty channel_type TLV bypassed feature checks and forced a legacy channelAdds explicit RPC and wire rejection with a dedicated error code
112cb5f3by ziggieXXX+265−4716 files
Vendor flagged security relevance
Moderate 56 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11223 from gijswijs/legacy-dust-retribution-fix

This update fixes a bug in how LND handles old-style punishment transactions when a channel partner tries to cheat. Previously, tiny (dust) HTLCs were left as blank placeholder entries in the punishment data, which could cause the node to …

nil-pointer dereference risk in breach retribution pathlegacy revocation log handling inconsistency with modern formatdefensive hardening added for trimmed/dust HTLCs
500ca51fby ziggieXXX+168−146 files
No security note in commit
Moderate 62 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11190 from Roasbeef/zpay32-reject-duplicate-payment-hashes

This change tightens how LND reads Lightning invoices (BOLT 11). Previously, if an invoice contained more than one payment hash field, LND would silently keep the first one and ignore the rest. Now it rejects the invoice entirely. The rele…

Behavior change from 'use first duplicate field' to 'reject duplicate fields'New error type ErrDuplicatePaymentHash returned on duplicate payment hash fieldsMalformed/unsupported-length duplicate payment hash now treated as duplicate and rejected
86306f89by Yong+147−106 files
No security note in commit
Moderate 62 AI analysisMessage 98 · Strong
LL Lightning LabsLND BitcoinLightning Network

zpay32: reject duplicate payment hash fields

This change tightens how LND reads Lightning invoices. Previously, if an invoice contained more than one payment hash field, LND would silently keep the first valid one and ignore the rest. Now it rejects such invoices outright. This preve…

Behavioral change from silent first-field acceptance to explicit rejection of duplicate payment hash fieldsPrevents invoice parsing from depending on field ordering when multiple payment hashes are presentCovers malformed first field + valid second field, closing a potential bypass
e2f27063by Olaoluwa Osuntokun+147−106 files
Vendor flagged security relevance
Moderate 53 AI analysisMessage 58 · Thin
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11132 from yyforyongyu/task-11129-pong

This change fixes how LND answers network 'ping' messages from other Lightning nodes. Previously, LND would sometimes silently ignore valid pings to limit reply traffic, which violates the Lightning protocol (BOLT 1) and could make a peer …

Protocol compliance fix: BOLT 1 requires a Pong for every valid PingRemoved silent suppression of Pong replies that could cause peer timeout/misbehaviorUnified rate limiting now accounts for amplification bandwidth, not just ping count
d3d1f1d0by Olaoluwa Osuntokun+274−1715 files
Vendor flagged security relevance
Low 33 AI analysisMessage 90 · Strong
LL Lightning LabsLND BitcoinLightning Network

itest: stop creating legacy channels

This commit updates LND's integration tests to stop using an obsolete 'legacy' channel type and adds a test confirming that LND now rejects that legacy type. The commit message says the real fix is elsewhere in the same pull request: previ…

Deprecated commitment format (legacy) is now rejected by RPCTest added to verify legacy channel type is refusedUnused legacy node configuration flag removed
03d8b09dby ziggie+24−85 files
No security note in commit
Moderate 60 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11198 from gijswijs/amp-setlocal-reconstruction-fix

This change fixes a bug in LND's handling of AMP (Atomic Multi-Path) payments. Previously, if one partial payment set failed to reconstruct its secret preimage, the entire invoice was canceled, including unrelated partial payment sets from…

Denial-of-service against reusable static AMP invoices by causing unrelated accepted HTLC sets to be canceledIncorrect invoice state transition from set-local failure to global invoice cancellationAvailability impact on multi-payer AMP invoice scenarios
88959aecby Olaoluwa Osuntokun+155−44 files
Vendor flagged security relevance
Low 29 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11200 from ziggie1984/build-go-1.27.1

This commit updates the Go programming language version used to build LND from 1.25.13/1.26.6 to 1.26.8 (language version) and 1.27.1 (toolchain). It also regenerates many automatically generated RPC files and adjusts linter settings. The …

Go version bump may indirectly address unlisted runtime/standard-library security fixesLarge regenerated protobuf files suggest dependency/toolchain refresh rather than logic changeLinter configuration expanded to suppress new checks, consistent with a toolchain upgrade
ef4820e5by Olaoluwa Osuntokun+4932−412670 files
No security note in commit
Informational 15 AI analysisMessage 92 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: adopt focused golangci-lint v2.13 checks

This commit is a routine build-maintenance change. It updates the project's Go linter configuration to a newer version and fixes the resulting style warnings: a WebSocket header spelling and several documentation comments that didn't start…

bada7ea3by ziggie+27−1911 files
No security note in commit
Informational 15 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnrpc: regenerate protos with Go 1.27

This commit is a housekeeping change that regenerates automatically generated RPC binding files using a newer Go compiler version. The only differences are in code comments (doc-comment formatting), not in actual program logic or API behav…

dd523108by ziggie+4501−369826 files
No security note in commit
Informational 20 AI analysisMessage 100 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: fix Go 1.27 compatibility

This commit is a routine build-and-test maintenance patch to make the LND codebase compile and pass tests with the upcoming Go 1.27 release. It upgrades the project's custom linter tool, refreshes many indirect tool dependencies, adjusts o…

No production code changesNo vulnerability fix or CVE reference presentDependency-only refresh in tools module (development tooling)
6b54a387by ziggie+365−3706 files
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: bump Go language and toolchain versions

This commit is a routine maintenance update that changes which version of the Go programming language is used to build the lnd project. It does not change any application logic, fix a bug, or address a security vulnerability. The project i…

b1f9ca66by ziggie+39−3930 files
No security note in commit
Moderate 60 AI analysisMessage 83 · Strong
LL Lightning LabsLND BitcoinLightning Network

invoices: cancel only the failing AMP set on reconstruction failure

This commit fixes a bug in LND's invoice handling for reusable AMP (Atomic Multi-Path) invoices. Previously, if one payment set failed to reconstruct its preimage, the entire invoice was canceled, even though other valid payment sets on th…

Denial-of-service-like availability impact: a malicious or buggy payer could cause a whole reusable AMP invoice to be canceled, blocking legitimate concurrent payersSet-local failure incorrectly escalated to invoice-global cancellationRegression test added for concurrent-set survival after reconstruction failure
d74ab6faby Gijs van Dam+141−42 files
No security note in commit
Informational 15 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

bolt12: describe the lnwire dependency

This is a documentation-only change. A package comment was updated to accurately describe that the bolt12 codec library does depend on LND's lnwire package for low-level message types, while clarifying it still does not interact with the r…

5f53171dby bitromortac+3−21 file
No security note in commit
Moderate 60 AI analysisMessage 91 · Strong
LL Lightning LabsLND BitcoinLightning Network

bolt12: cover the amount overflow guard

This commit adds a test to ensure that when a BOLT 12 invoice is validated against a request, the multiplication of the offer amount by the requested quantity cannot overflow and wrap around to zero. Without this guard, a malicious or malf…

Integer overflow / wraparound in amount calculationMissing test coverage for security-critical branchBOLT 12 invoice amount validation
3c8e2bcbby bitromortac+47−01 file
Vendor flagged security relevance
Low 34 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11061 from bitromortac/2604-bolt12-1f

This commit adds the missing cryptographic signature layer for BOLT 12 offers in LND. It builds a Merkle tree from the message fields, signs that tree with a BIP-340 Schnorr signature, and now rejects invoice requests and invoices whose si…

Adds BIP-340 Schnorr signature verification for BOLT 12 invoice_request and invoice messagesMerkle tree commits to canonical re-encoded TLV records; non-minimal feature/amount encodings now rejected to preserve byte-exactnessSignature TLV type 240 and reserved range 240-1000 excluded from the signed Merkle root
1049d301by Yong+2076−7815 files
Vendor flagged security relevance
Low 35 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11125 from bhandras/codex/reorg-aware-output-lock-20260825

This commit adds a new optional wallet feature to LND that lets users lock UTXOs until the transaction spending them reaches a chosen confirmation depth, instead of relying on a wall-clock timeout. It is a feature addition with safety chec…

New RPC fields release_after_spend_confs and confirmed_spend_height added to LeaseOutput and FundPsbtCustom lock ID enforced as required for confirmation-controlled FundPsbt leases; all-zero and reserved internal IDs rejectedCapability check (ResolveOutputLeaser) prevents silent downgrade to time-only lease when confirmation control is requested
80dde144by Yong+1293−10021 files
No security note in commit
Informational 19 AI analysisMessage 58 · Thin
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #10812 from ziggie1984/chanstate-kv-store-move

This commit is a large internal code reorganization for the LND Lightning node. It moves channel state storage logic from the `channeldb` package into a new `chanstate` package, while keeping the same database keys, serialization formats, …

Large refactoring with no change to cryptographic or consensus-critical logicCodec serialization moved verbatim to new package; wire format unchangedDatabase bucket keys and TLV record types preserved
62b0a073by Olaoluwa Osuntokun+3923−310924 files
No security note in commit
Low 25 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #10804 from GeorgeTsagk/close-immediately-itest-lnd-7c38

This change fixes a data-handling bug in LND's channel-opening code. When opening a Lightning channel using an optional 'auxiliary funding controller' (used for custom channel types such as Taproot Assets), the funding manager was previous…

Data-correctness fix in funding handshake: negotiated channel configs now exposed to auxiliary funding controllerAuxiliary funding controller receives incomplete channel state before patch, complete state after patchNo explicit security claim, CVE, or advisory referenced in commit or supplied materials
1e127653by Olaoluwa Osuntokun+291−254 files
No security note in commit
Moderate 60 AI analysisMessage 88 · Strong
LL Lightning LabsLND BitcoinLightning Network

bolt12: verify invoice_request and invoice signatures on read

This change makes LND's BOLT 12 invoice and invoice-request reader actually check that the digital signature is valid, instead of only checking that a signature field exists. Before, an attacker could craft or modify a BOLT 12 message and …

Missing cryptographic verification on parsed BOLT 12 messages replaced with BIP-340 Schnorr signature verificationReader accepted any 64-byte placeholder signature before the patchNew negative tests verify rejection of wrong-signer and tampered Merkle-root fields
aa8bd19fby bitromortac+272−723 files
Vendor flagged security relevance
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Security candidategraph/db/migration1: fix defer commit/rollback in test tx executorby ziggie · 932fbc33 · Feb 25, 2026 · 1 fileMessage 83 · StrongInformational 21Details
Commit message · ziggie

graph/db/migration1: fix defer commit/rollback in test tx executor

The defer closure checked a local err variable for commit/rollback
decisions, but err remained nil after a successful BeginTx. When
txBody failed, the error was returned directly without assigning to
err, so the defer always committed instead of rolling back.

Additionally, since err was not a named return value, the defer's
Commit error assignment was silently swallowed.

Replace the error-prone defer pattern with explicit rollback on
txBody failure and a direct Commit return.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing boundary
AI analysis · Informational 21/100

This commit fixes a bug in a test helper that runs database transactions for LND's graph database migration tests. The old code accidentally committed every transaction, even when the inner test work failed, because of a subtle Go error-handling mistake. The fix makes failed transactions roll back and successful ones commit properly. This is test-only code, so it does not directly affect live Lightning nodes, but it could have caused migration tests to leave partial or incorrect data in the database instead of rolling back as intended.

Lower-prioritysqldb: add migration consistency testby ziggie · a2c36d16 · Feb 25, 2026 · 1 fileMessage 70 · AdequateInformational 15Details
Commit message · ziggie

sqldb: add migration consistency test

Tests that all migration files follow the defined schema and that
there are not duplicates which could cause collision.

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit adds a new automated test that checks whether database migration files are correctly named, uniquely numbered, and match the project's internal migration list. It does not change any production code or fix a live bug; it only adds a safety check to catch human errors during future development.

Lower-prioritypayments/db: split migration queries into dedicated SQLMigrationQueries interfaceby ziggie · cf3610ab · Feb 25, 2026 · 5 filesMessage 50 · ThinInformational 15Details
Commit message · ziggie

payments/db: split migration queries into dedicated SQLMigrationQueries interface

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit is a straightforward internal code cleanup in LND's payment database code. It splits migration-only database query methods out of the general SQLQueries interface into a new SQLMigrationQueries interface. There is no security bug being fixed here; it is a refactoring change to make the codebase clearer and prevent accidental use of migration-only queries in normal operation.

AI review queuedmod: update new direct dependency via go mod tidyby ziggie · c862e701 · Feb 25, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · ziggie

mod: update new direct dependency via go mod tidy

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
second-pass: broader security terminology
AI analysis · Informational 15/100

This commit is a routine Go module housekeeping change. It removes the '// indirect' label from a tiny helper library (go-difflib) so Go recognizes it as a direct dependency. There is no code change, no bug fix, and no security-relevant behavior change visible in the diff.

Lower-prioritypayments/migration1: add external migration testby ziggie · 4b30bed0 · Feb 25, 2026 · 2 filesMessage 78 · AdequateInformational 15Details
Commit message · ziggie

payments/migration1: add external migration test

Add a developer-facing migration_external_test that allows
running the KV→SQL payments migration against a real channel.db
backend to debug migration failures on actual data. The accompanying
testdata README documents how to supply a database file and configure
the test, so users can validate their data and confirm the migration
completes successfully.

The test is skipped by default and meant for manual diagnostics.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
defensive validation
AI analysis · Informational 15/100

This commit only adds a new developer test file and a README for manually debugging database migrations. The test is skipped by default and requires a developer to edit the code and supply their own database file before it will run. There is no change to production code, no fix for a security issue, and no new vulnerability introduced.

Lower-prioritypayments/migration1: add migration test suite and helpersby ziggie · f058f332 · Feb 25, 2026 · 5 filesMessage 95 · StrongInformational 15Details
Commit message · ziggie

payments/migration1: add migration test suite and helpers

Add test helpers plus sql_migration_test coverage for KV→SQL migration.
Basic migration, sequence ordering, data integrity, and feature-specific cases
(MPP/AMP, custom records, blinded routes, metadata, failure messages). Also
cover duplicate payment migration to payment_duplicates, including missing
attempt info to ensure terminal failure is recorded.

This gives broad regression coverage for the migration path and its edge-cases.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only adds new test code and test helpers for an existing database migration. It does not change any production logic, runtime behavior, or user-facing functionality. There is no security issue in the commit itself.

Lower-prioritypayments/migration1: handle legacy payments with nil HTLC hashby ziggie · 89685de1 · Feb 25, 2026 · 2 filesMessage 73 · AdequateLow 27Details
Commit message · ziggie

payments/migration1: handle legacy payments with nil HTLC hash

For legacy payments, the HTLC Hash field may be nil in the bbolt
backend. Previously, the migration would fail with "HTLC attempt X
missing payment hash" when encountering such payments.

This commit fixes the migration by falling back to the parent payment
hash when the HTLC-specific hash is nil. This is consistent with how
the router handles legacy payments (see patchLegacyPaymentHash in
payment_lifecycle.go).

The validation logic is also updated to apply the same fallback when
comparing bbolt data with migrated SQL data, ensuring the comparison
succeeds.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 27/100

This commit fixes a database migration bug in LND's payment storage upgrade. Older Lightning payments sometimes didn't store a payment hash on each individual HTLC (payment attempt). The migration to a new SQL database previously failed when it encountered these legacy records. The fix simply falls back to the parent payment's hash, matching how the rest of LND already treats legacy payments. This is a reliability fix, not an exploitable security vulnerability.

Lower-prioritypayments/migration1: wire KV→SQL migration in the main pkgby ziggie · f174b60b · Feb 25, 2026 · 4 filesMessage 85 · StrongLow 30Details
Commit message · ziggie

payments/migration1: wire KV→SQL migration in the main pkg

Hook the payments KV→SQL migration into the SQL migration config.
The migration is still only available when building with the build tag
"test_native_sql".

Moreover a tombstone protection similar to the invoice migration is added
to prevent re-runningi with the KV backend once migration completes.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 30/100

This commit wires a new experimental database migration into LND that moves payment data from an older key-value store to a newer SQL-based store. It also adds a 'tombstone' marker so that, once the migration runs, the old key-value store cannot be used again. The change is only active when a special test build tag is used, so it does not affect normal production builds. There is no direct security vulnerability visible in the diff, but any database migration carries operational risks such as data loss or being unable to restart the node if something goes wrong.

AI review queuedpayments/migration1: freeze core payment codeby ziggie · fb705bb0 · Feb 25, 2026 · 17 filesMessage 80 · StrongLow 31Details
Commit message · ziggie

payments/migration1: freeze core payment code

Copy the core payments/db code into payments/db/migration1 and
add the required sqlc-generated types/queries from sqldb/sqlc.
This effectively freezes the migration code so it stays robust
against future query or schema changes in the main payments package.

Replace the delegation to channeldb.ReadElement/WriteElement with
self-contained, frozen implementations that only handle the exact types
required by this migration package. This removes the dependency on the
live channeldb codec so that future changes to channeldb serialization
cannot silently corrupt or break the migration.

UnknownElementType is also defined locally for the same reason.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
second-pass: broader security terminology
AI analysis · Low 31/100

This commit is a defensive code-freeze: it copies the core payment database logic into a dedicated migration1 package so that future changes to the main payments code or serialization format cannot accidentally break or corrupt old payment data during upgrades. It is a hardening/refactoring change, not an active vulnerability fix, and it reduces the risk of migration bugs rather than introducing new exploit paths.

Lower-prioritysqldb+payments: add payment_duplicates for legacy duplicate paymentsby ziggie · 74f8f2d9 · Feb 25, 2026 · 7 filesMessage 85 · StrongInformational 18Details
Commit message · ziggie

sqldb+payments: add payment_duplicates for legacy duplicate payments

Older LND versions could create multiple payments for the same hash.
We need to preserve those historical records during KV→SQL migration,
but they don’t fit the normal payment schema because we enforce a
unique payment hash constraint. Introduce a lean payment_duplicates
table to store only the essential fields (identifier, amount,
timestamps, settle/fail data).

This keeps the primary payment records stable and makes the migration
deterministic even when duplicate records lack attempt info. The table
is intentionally minimal and can be dropped after migration if no
duplicate payments exist.

For now there is no logic in place which allows the noderunner to
fetch duplicate payments after the migration.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 18/100

This commit adds a new database table called payment_duplicates to help migrate old LND payment records into a new SQL database. Older versions of LND could accidentally create multiple payments with the same identifier, which conflicts with the new database's rule that each payment hash must be unique. The new table stores the extra duplicate records separately during migration so no data is lost. It is not a security fix and does not change how live payments are handled; it only preserves historical records.

Lower-prioritypayments/migration1: add the payments mig codeby ziggie · a9747207 · Feb 25, 2026 · 2 filesMessage 80 · StrongLow 30Details
Commit message · ziggie

payments/migration1: add the payments mig code

Implement the KV→SQL payment migration and add an in-migration
validation pass that deep-compares KV and SQL payment data in batches.
Duplicate payments are migrated into the payment_duplicates table,
and duplicates without attempt info or explicit resolution are marked
failed to ensure terminal state. Validation checks those rows as well.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 30/100

This commit adds new code that migrates old-style payment records into a new SQL database format and checks that the migrated data matches the original. It is a data-integrity migration, not a typical security patch. The code does not obviously introduce remote attacks, but it changes how sensitive payment history is stored and interpreted. Any bug here could corrupt payment state, misclassify failed payments as successful (or vice versa), or lose duplicate-payment records. The commit itself does not claim to fix a security vulnerability.

Lower-prioritypaymentsdb+sqldb: add migration related queryby ziggie · 2596d346 · Feb 25, 2026 · 4 filesMessage 60 · AdequateInformational 18Details
Commit message · ziggie

paymentsdb+sqldb: add migration related query

Add a migration specific query which allows to set the failure
reason when inserting a payment into the db.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 18/100

This commit adds two database helper functions used only during a one-time upgrade from the old key-value storage to the new SQL database in LND. One helper lets the migration insert old payments that already have a failure reason, and the other fetches batches of payments with their attempt counts for validation. There is no user-facing change, no bug fix, and no security patch in the diff itself.

AI review queuedpaymentsdb: fix duplicate interface check and down migration drop orderby ziggie · e9a88267 · Feb 25, 2026 · 2 filesMessage 73 · AdequateInformational 18Details
Commit message · ziggie

paymentsdb: fix duplicate interface check and down migration drop order

- Remove duplicate compile-time interface assertion for SQLStore.

- Fix the down migration to drop payment_intents before payments to
respect the foreign key dependency order. This was not a bug in the
first place bc we have the CASCADE when deleting payments.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Informational 18/100

This commit is a minor cleanup in LND's payment database code. It removes a duplicate compile-time type check and reorders two table-drop statements in a database downgrade script. The author notes the reordering was not actually a bug because the database already uses CASCADE deletes. There is no apparent security vulnerability here.

AI review queuedpaymentsdb: fix SettleAttempt and FailAttempt to use caller-provided timestampsby ziggie · 0c2951aa · Feb 25, 2026 · 2 filesMessage 83 · StrongInformational 19Details
Commit message · ziggie

paymentsdb: fix SettleAttempt and FailAttempt to use caller-provided timestamps

The SQL backend introduced in this PR was ignoring the SettleTime and
FailTime fields provided in HTLCSettleInfo and HTLCFailInfo, instead
always recording time.Now() as the resolution timestamp. The KV backend
correctly serializes and deserializes these fields.

The timestamps are set by the caller using a mockable clock
(p.router.cfg.Clock.Now() in payment_lifecycle.go), so ignoring them
means the stored timestamp reflects when the DB write happened rather
than when the event occurred, breaking deterministic testing.

This commit also extends the test assertions in assertPaymentInfo to
verify that SettleTime and FailTime are correctly stored and retrieved
by the SQL backend, and updates the relevant call sites to pass explicit
timestamps so regressions are caught.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
second-pass: broader security terminology
AI analysis · Informational 19/100

This commit fixes a bug in LND's SQL payment database where the code was ignoring caller-provided timestamps and always using the current time when recording when a payment succeeded or failed. The fix makes stored timestamps match the actual event time, which is important for reliable automated tests and consistent record-keeping. There is no direct security exploit here.

Lower-prioritypaymentsdb: sort FetchInFlightPayments result by sequence numberby ziggie · 216de55d · Feb 25, 2026 · 1 fileMessage 85 · StrongInformational 18Details
Commit message · ziggie

paymentsdb: sort FetchInFlightPayments result by sequence number

The SQL implementation collects payments into a map before converting
to a slice, resulting in non-deterministic iteration order due to Go's
intentional map randomisation. Sort the result by SequenceNum to produce
a deterministic, insertion-ordered output.

Note that the current sole caller (resumePayments in router.go) processes
each payment independently, so this ordering does not affect any existing
behaviour.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 18/100

This change fixes a minor non-deterministic ordering bug in the database layer that returns in-flight Lightning payments. Because Go randomizes map iteration order, the list of payments could come back in a different order each time. The patch sorts the results by an internal sequence number so the order is stable. The commit message explicitly states the only current caller processes each payment independently, so existing behavior is unaffected.

Lower-prioritygraphdb: thread topology update contextby Elle Mouton · 262e9208 · Feb 25, 2026 · 2 filesMessage 45 · ThinInformational 15Details
Commit message · Elle Mouton

graphdb: thread topology update context

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This is a small internal code-quality change in LND's channel graph database. It replaces a hard-coded placeholder context with a single context variable that is passed through a few related functions. There is no security-relevant behavior change visible in the diff.

Lower-prioritygraphdb: pass context to PruneGraphNodesby Elle Mouton · 13668ce4 · Feb 25, 2026 · 6 filesMessage 45 · ThinInformational 15Details
Commit message · Elle Mouton

graphdb: pass context to PruneGraphNodes

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit is a routine code cleanup: it adds a context.Context parameter to the PruneGraphNodes function so callers can pass cancellation/timeout information. The SQL implementation previously used a placeholder TODO context, and now receives a real context from callers. There is no security-relevant behavior change visible in the diff.

Lower-prioritygraphdb: pass context to ChannelViewby Elle Mouton · 9f855175 · Feb 25, 2026 · 6 filesMessage 45 · ThinInformational 17Details
Commit message · Elle Mouton

graphdb: pass context to ChannelView

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 17/100

This change simply threads a request-scoped cancellation context through the ChannelView database call. It does not fix an active bug by itself, but it is a small cleanup that lets long-running graph queries respect cancellation signals. There is no direct security vulnerability visible in the diff.

Lower-prioritygraphdb: pass context to FilterKnownChanIDsby Elle Mouton · 072244ee · Feb 25, 2026 · 6 filesMessage 45 · ThinInformational 15Details
Commit message · Elle Mouton

graphdb: pass context to FilterKnownChanIDs

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit is a routine code cleanup: it threads a request-scoped cancellation context through a graph database helper called FilterKnownChanIDs. Previously the SQL backend created a blank context.TODO() inside the function, while the caller also used context.TODO(). Now the caller's context is passed down, which is better engineering practice but does not by itself fix a security vulnerability. There is no change to access control, cryptography, network behavior, or data validation.

Lower-prioritygraphdb: pass context to FetchChanInfosby Elle Mouton · 46d37a69 · Feb 25, 2026 · 7 filesMessage 45 · ThinInformational 18Details
Commit message · Elle Mouton

graphdb: pass context to FetchChanInfos

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 18/100

This change simply threads a cancellation signal (a 'context') through a database lookup function called FetchChanInfos. It does not fix a crash, stop a theft, or close a privacy hole on its own. It is a routine plumbing improvement that lets callers cancel long-running queries cleanly, which can help avoid resource exhaustion in edge cases.

Lower-prioritygraphdb: pass context to AddEdgeProofby Elle Mouton · 68c52060 · Feb 25, 2026 · 6 filesMessage 45 · ThinInformational 15Details
Commit message · Elle Mouton

graphdb: pass context to AddEdgeProof

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit is a routine code cleanup: it threads a request-scoped cancellation context through the AddEdgeProof function instead of creating a blank context.TODO() inside the SQL database path. There is no security-relevant behavior change; it simply lets callers pass their own context for timeouts and cancellation.

Lower-prioritygraphdb: pass context to GraphSessionby Elle Mouton · 0bb0d669 · Feb 25, 2026 · 9 filesMessage 45 · ThinInformational 18Details
Commit message · Elle Mouton

graphdb: pass context to GraphSession

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 18/100

This commit is a small internal cleanup: it threads a Go request-lifecycle 'context' through the GraphSession database-query helper so callers can cancel or time out graph lookups. The only concrete behavior change is in the SQL backend, where a hard-coded placeholder context.TODO() is replaced by the caller-supplied context. There is no direct security fix, exploit, or vulnerability visible in the diff, but it removes a future foot-gun where graph queries could not respect cancellation/timeouts.

Lower-prioritygraphdb: pass context to IsClosedScidby Elle Mouton · 8722a96a · Feb 25, 2026 · 9 filesMessage 45 · ThinInformational 14Details
Commit message · Elle Mouton

graphdb: pass context to IsClosedScid

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 14/100

This commit is a straightforward internal code cleanup: it threads a request context through the IsClosedScid function and all its callers. The change itself does not fix a crash, bug, or security vulnerability; it merely makes cancellation/timeouts possible for future SQL-backed calls and keeps the API consistent with other functions that already take a context.

Lower-prioritygraphdb: pass context to PutClosedScidby Elle Mouton · 4dcaf1c1 · Feb 25, 2026 · 8 filesMessage 45 · ThinInformational 14Details
Commit message · Elle Mouton

graphdb: pass context to PutClosedScid

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 14/100

This change simply threads a request-scoped cancellation signal (a 'context') through a database helper that records closed Lightning channels. It does not fix a crash, stop an attacker, or change any user-visible behavior. The previous code used a placeholder context inside the SQL backend, which meant database operations could not be cancelled cleanly; now the caller's context is passed through so long-running operations can be aborted if the request is cancelled. This is a code-quality and maintainability improvement, not a security patch.

Lower-prioritygraphdb: pass context to DisconnectBlockAtHeightby Elle Mouton · 3dc2efd7 · Feb 25, 2026 · 6 filesMessage 45 · ThinInformational 16Details
Commit message · Elle Mouton

graphdb: pass context to DisconnectBlockAtHeight

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 16/100

This is a small internal code cleanup change in LND's channel graph database code. It adds a context.Context parameter to the DisconnectBlockAtHeight function so callers can pass cancellation/timeout information down to the SQL backend. The change does not fix a known security bug and does not introduce an obvious vulnerability. It is a routine refactoring to make the code more consistent and testable.