LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

1689 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.

187security candidates237second-pass queue1374AI analyses
164commits · 30 days
270commits · 60 days
640commits · 180 days
1424commits · 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.

68/100 average clarity
388Strong · 80–100
838Adequate · 60–79
432Thin · 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 Osuntokun29860237474
ziggie49922422265
Elle Mouton26832268167
Yong60926172
ziggieXXX50617170
George Tsagkarelis37335167
LNBiG111173
Jared Tobin909171
yyforyongyu1211574070
bitromortac731154071
Erick Cestari26726070
Suheb746074
Analysis record

Published AI watches

Last scanned 49 minutes ago

Moderate 66 AI analysisMessage 96 · Strong
LL Lightning LabsLND BitcoinLightning Network

channeldb: persist local updates the peer acked before our first revoke (#11268)

This commit fixes a bug in LND's channel database where a specific type of fee update could be lost if a node restarted at a very precise moment during a Lightning channel's setup. If triggered, the node would reject a valid signature from…

Force-closure of a Lightning channel due to state desynchronization after restartLoss of locally initiated fee updates before first local revocationRegression test reproduces restart scenario leading to signature rejection
9f5e2c7bby Olaoluwa Osuntokun+78−133 files
Vendor flagged security relevance
Low 45 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11575 from Roasbeef/rbf-coop-close-lifecycle

This commit fixes bugs in LND's new RBF-style cooperative channel close feature. Previously, fee-bump requests could be dropped or block the peer's main goroutine while waiting for an in-progress offer. The patch buffers those requests ins…

Denial-of-service / liveness fix: fee-bump requests no longer block the peer's `channelManager` goroutine while waiting for an in-flight offer.State consistency fix: buffered fee-bump requests are now part of the FSM state instead of being dropped during shutdown or flush.Resource-leak fix: confirmed RBF closes now tear down the active channel state and switch link for both local and remote-initiated closes.
5597f6f7by Olaoluwa Osuntokun+1538−4248 files
Vendor flagged security relevance
Low 43 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11588 from ziggie1984/lnwallet/fix-reorg-wallet-sync-flake

This change fixes a wallet synchronization check in LND. Previously, the wallet only compared block heights to decide if it was fully caught up with the Bitcoin chain. During a chain reorganization (a temporary fork where one block is repl…

State synchronization check previously used height only, which is insufficient across reorgsFix adds block hash comparison to prevent false-positive sync statusCould cause LND to proceed while wallet state reflects an invalidated or not-yet-updated chain tip
8cdbf85cby Yong+224−1354 files
Vendor flagged security relevance
Moderate 51 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #10708 from jtobin/alias-perms

This commit fixes a missing permission check on a new Lightning routing RPC called XFindBaseLocalChanAlias. Without the entry, any valid macaroon could call that RPC, bypassing the normal access-control list. The patch adds the required pe…

Missing macaroon authorization entry for an RPC endpointPotential privilege escalation: any valid macaroon could invoke an unprotected RPCRegression test added to enforce macPermissions coverage
98dc2b44by Olaoluwa Osuntokun+35−02 files
No security note in commit
Moderate 68 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11555 from yyforyongyu/invoice-settlement-public

This large LND patch changes when an ordinary invoice is considered 'paid'. Previously, releasing the preimage (the secret that lets the payer claim the funds) immediately marked the invoice as settled. Now the invoice enters a new interme…

New intermediate invoice/HTLC state prevents premature settlement reportingOn-chain HTLC outcomes persisted without opt-in to support restart recoveryForwarding package marker persisted before preimage release to avoid replay rejection on restart
895118acby Olaoluwa Osuntokun+4536−32048 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 80 · Strong
LL Lightning LabsLND BitcoinLightning Network

docs: describe invoice collection finality

This commit only adds documentation to the release notes. It describes a previously merged code change (PR 11555) about how LND handles invoice finality, but the commit itself contains no code, bug fixes, or behavior changes. There is noth…

9649d9f6by yyforyongyu+87−01 file
No security note in commit
Moderate 64 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11551 from ziggie1984/public-pr149-sanitized

This change fixes a bug in LND's invoice handling for multi-part payments (MPP and AMP). When a payment is split into several pieces (HTLCs), each piece is accepted individually. Previously, an old accepted piece could become too close to …

Fixes missing revalidation of accepted HTLC CLTV expiries at MPP/AMP set completionPrevents settlement of shards whose on-chain claim window has become unsafe while heldAdds new fail resolution ResultHtlcSetExpiryTooSoon and cancels the entire affected set
4b7447bcby Yong+281−347 files
Vendor flagged security relevance
Low 35 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11396 from yyforyongyu/task-lease-policy

This commit changes how LND's wallet locks (leases) unspent coins through its RPC interface. It removes a recently added 'release after N confirmations' option and replaces it with an explicit 'no expiry' flag. Old clients that still send …

Breaking API change that reserves removed protobuf fields to prevent accidental reintroductionExplicit rejection of legacy `release_after_spend_confs` parameters from old clients instead of silent fallbackValidation prevents conflicting no-expiry + duration lease settings before wallet state is touched
03e28a96by Yong+663−4029 files
Vendor flagged security relevance
Low 40 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11175 from ViktorT-11/2026-08-gossip-version-agnostic-store

This commit refactors how the Lightning Network Daemon (LND) stores and queries channel graph data so that the same channel or node can exist under both old (v1) and new (v2) gossip protocols without the database returning stale, missing, …

Cross-version data consistency: prevents a v2 channel shell from shadowing a usable v1 channel, which could affect routing decisions and RPC output.Cache consistency: ensures the in-memory pathfinding cache and the SQL-backed RPC reads agree on which channel version and policies are active.Bug fix: zombie edge info now carries the correct channel ID instead of 0, which could have caused incorrect channel identification during resurrection.
8c251687by Yong+3752−28726 files
No security note in commit
Moderate 61 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11440 from Roasbeef/fix-longstanding-correctness-bugs

This is a large bug-fix patch for LND (a Bitcoin Lightning Network node) that tightens correctness rules across many subsystems. It prevents several ways a node could mis-handle channel data, accept bad network gossip, commit corrupted dat…

Database transaction commit now aborts on read errors (etcd) - prevents silent data corruption / inconsistent stateGossip zombie marking removed for invalid funding script - prevents denial-of-service / channel graph poisoningWire message length bounding added to watchtower protocol - prevents memory exhaustion / malformed message parsing
0123a548by Olaoluwa Osuntokun+1424−11938 files
Vendor flagged security relevance
Moderate 59 AI analysisMessage 80 · Strong
LL Lightning LabsLND BitcoinLightning Network

invoices: require complete payment collection

This commit changes how LND handles multi-part Lightning payments when one part fails after the preimage was already released. Previously, the invoice could be marked as fully paid even if one shard was later reclaimed by the payer on-chai…

Changes invoice settlement semantics for released-but-failed HTLCsAdds new persisted HTLC state `HtlcStateFailed`Prevents invoice from reaching `ContractSettled` when any released shard fails
699ea930by Olaoluwa Osuntokun+492−4910 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnwallet: reject a zero CSV delay

This change tightens the rules for opening Lightning payment channels by refusing a setting called the CSV delay when it is set to zero. The CSV delay is the waiting period a user must endure before reclaiming their own funds from a channe…

Rejects a zero CSV delay that would eliminate the breach-remedy windowCentralizes the check in VerifyConstraints so all channel types and directions are coveredAdds explicit error type and unit test for the new constraint
266eba7bby Olaoluwa Osuntokun+81−03 files
Vendor flagged security relevance
Moderate 58 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnwallet+chanstate: keep persisted HTLC data readable

This commit fixes two bugs in how Lightning Network channel data is saved to disk. First, it stops extra 'aux' signatures meant only for advanced taproot channels from being saved on ordinary channels, where they don't belong. Second, it p…

Persisted state could become unreadable due to writer/reader size mismatchAuxiliary signatures for taproot overlay channels were persisted on plain channel HTLCsFix adds explicit serialization bound to prevent unreadable channel records
43c74723by Olaoluwa Osuntokun+101−25 files
No security note in commit
Low 39 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11374 from bitromortac/20261016-c7e5-dispatch

This commit adds the first end-to-end BOLT 12 'Offers' flow to LND: a new dev-only RPC and CLI command to create offers, plus a dispatcher that listens for incoming onion-message invoice requests and replies with signed BOLT 12 invoices. I…

New network-facing dispatcher answers invoice requests from any peer; rate and concurrency limits are appliedBlinded-path PathID check prevents reply linking to self-created paths, but TODO notes the check should move once offers can have offer_pathsCreateOffer RPC is restricted to dev builds and requires offchain:write macaroon permission
a9d4ca3bby bitromortac+3113−7838 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
LL Lightning LabsLND BitcoinLightning Network

invoices: reject settled AMP set shards

This change fixes a bug in LND's invoice handling for AMP (Atomic Multi-Path) payments. Previously, if someone tried to pay a fresh shard for an AMP set that was already fully paid, the invoice updater could return an internal error that w…

Denial-of-service vector: an internal updater error could force-fail a shared channel link, disrupting unrelated sibling HTLCsAMP invoice state machine edge case: reusable invoice stays open for other sets but must reject new shards for already-settled setsClean failure path introduced: ResultInvoiceNotOpen instead of error-driven link failure
99e3da37by yyforyongyu+49−02 files
No security note in commit
Moderate 59 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11282 from lightningnetwork/elle-base-branch-payment-service

This is a large feature merge for LND that adds a new optional RPC subsystem called switchrpc. It lets an external program hand a pre-built onion packet to LND for direct dispatch over a Lightning channel, instead of LND doing its own path…

New optional RPC surface (switchrpc) that accepts externally crafted onion packets and directly dispatches HTLCsIdempotency/deduplication added via InitAttempt durable write-ahead log and ErrPaymentIDAlreadyExistsStartup orphan cleanup fails half-open or pre-commit attempts to avoid hangs
11f79be0by Olaoluwa Osuntokun+11385−22458 files
Vendor flagged security relevance
Low 44 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11472 from yyforyongyu/task-sweep-rejections

This commit fixes a bug in LND's transaction sweeping logic. Previously, if the Bitcoin backend rejected a sweep transaction for a temporary or unknown reason (for example, the mempool was full, a network error occurred, or the rejection r…

Funds-availability / liveness fix: temporary or unknown mempool rejections could leave sweep inputs unspent.Error-handling reclassification: previously fatal errors now retryable.Retry metadata preservation: next fee rate and fee cap kept across attempts.
c5863e55by Yong+290−9720 files
No security note in commit
Low 32 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11292 from ViktorT-11/2026-10-harden-remote-signing-no-op

This change is a hardening fix for LND's remote-signing feature. Previously, if a node was configured to act as an outbound remote signer but was compiled without the required 'signrpc' and 'walletrpc' sub-servers, it would silently fall b…

silent-degradation-to-no-op preventedconfiguration-misconfiguration now surfaces as fatal errorbuild-tag-dependency explicitly validated at runtime
0c538e1fby Suheb+241−125 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

invoices: fix test whitespace

This commit only fixes blank-line spacing in a single test file to satisfy lint checks. It adds one blank line after a function signature and removes one trailing blank line. There are no code behavior changes, no bug fixes, and no securit…

a67d07f4by yyforyongyu+1−11 file
No security note in commit
Low 31 AI analysisMessage 92 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: pin the new lint job actions by commit

This change updates two GitHub Actions used in the project's automated lint workflow so they are locked to specific commit hashes instead of floating version tags. A floating tag could be silently repointed to a different, possibly malicio…

CI/CD supply-chain hardeningthird-party action pinning by commit hashprevention of tag-movement attacks
2a9f137dby Olaoluwa Osuntokun+4−21 file
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 candidateci: use GITHUB_TOKEN instead of PAT for PR severity workflowby ziggie · 77c566f2 · Apr 8, 2026 · 1 fileMessage 97 · StrongLow 32Details
Commit message · ziggie

ci: use GITHUB_TOKEN instead of PAT for PR severity workflow

The PR severity classifier only needs to run `gh pr view`, `gh pr edit`
(labels), and `gh pr comment`. All three operations are fully covered by
the built-in GITHUB_TOKEN given the existing permissions block:

permissions:
contents: read
pull-requests: write
issues: write

The workflow uses `pull_request_target`, which runs in the base repo
context, so GITHUB_TOKEN has write access even for fork PRs.

Inspection of the claude-code-action@v1 source confirmed that the only
internal call that would require `contents: write` is branch deletion,
which is never exercised here because Claude's tools are locked down to
`gh pr view/edit/comment` via --allowedTools.

This removes the dependency on the PR_SEVERITY_BOT_TOKEN PAT secret.

97/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
credential or privilege statedocumentation-only discount
AI analysis · Low 32/100

This commit changes a GitHub Actions workflow so it uses the automatically provided GITHUB_TOKEN instead of a long-lived personal access token (PAT) named PR_SEVERITY_BOT_TOKEN. The workflow labels and comments on pull requests. The change reduces the risk that a leaked or overly powerful PAT could be misused, and it is a security-hardening improvement rather than a fix for an active vulnerability.

Lower-prioritypaymentsdb: log unexpected nil attempt hashesby yyforyongyu · 412db8ae · Apr 8, 2026 · 1 fileMessage 68 · AdequateInformational 17Details
Commit message · yyforyongyu

paymentsdb: log unexpected nil attempt hashes

RegisterAttempt falls back to the payment identifier when an attempt
hash is nil so legacy data can still round-trip safely. In live router
code, however, a nil attempt hash should never happen for newly
registered attempts.

Add an error log on the fallback path so an unexpected nil attempt hash
is surfaced immediately instead of silently persisting the fallback
value.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 17/100

This commit adds an error log when a piece of routing data (an HTLC attempt hash) is unexpectedly missing, so the fallback behavior is no longer silent. It is a defensive observability improvement, not a fix for an exploitable vulnerability.

Lower-priorityitest: wait for active channels before replaying paymentsby yyforyongyu · d9c7c818 · Apr 7, 2026 · 2 filesMessage 50 · ThinInformational 15Details
Commit message · yyforyongyu

itest: wait for active channels before replaying payments

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

This commit only changes integration tests for the LND Lightning node software. It replaces a brief wait with an explicit check that both sides of a payment channel are active before sending test payments. There is no change to production code, no user-facing behavior change, and no security fix.

Lower-prioritylntest: retry mempool snapshots during RBF churnby yyforyongyu · d2d0cfa0 · Apr 7, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · yyforyongyu

lntest: retry mempool snapshots during RBF churn

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

This change only affects internal test code. It makes a test helper retry when the Bitcoin mempool changes while it is being read, which can happen during Replace-By-Fee (RBF) transactions in tests. There is no change to production LND node code, no user-facing behavior change, and no security fix.

Lower-prioritygraph/db: tighten TestFilterChannelRangeVersionGuard assertionsby Elle Mouton · a390ddd0 · Apr 7, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: tighten TestFilterChannelRangeVersionGuard assertions

Use isSQLDB to explicitly assert the expected outcome per backend:
SQL should succeed with empty results, KV should return
ErrVersionNotSupportedForKVDB.

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

This commit only changes a test file to make its assertions more precise. It does not modify any production code, so it cannot introduce a security vulnerability or fix one in running software. The change clarifies that one database backend should accept a request and return empty results, while another older backend should reject it with a specific error.

Lower-prioritygraph/db: convert TestDisconnectBlockAtHeight to versioned testby Elle Mouton · b73fa5f3 · Apr 7, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

graph/db: convert TestDisconnectBlockAtHeight to versioned test

Rename to testDisconnectBlockAtHeight and add it to the versionedTests
table so it runs against both v1 and v2 backends.

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

This commit only changes a test file. It renames an existing test and makes it run against two different versions of the underlying database backend, rather than just one. There are no changes to production code that handles real user funds or network data.

Lower-prioritygraph/db: convert TestGraphZombieIndex to versioned testby Elle Mouton · 0d82676d · Apr 7, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

graph/db: convert TestGraphZombieIndex to versioned test

Rename to testGraphZombieIndex and add it to the versionedTests table
so it runs against both v1 and v2 backends. The assertNumZombies
helper is updated to accept a gossip version parameter.

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

This commit only changes a test file. It renames an existing test so it runs against two different database backends and updates a helper function to accept a version parameter. There is no change to production code, no bug fix, and no security relevance.

Security candidategraph/db: convert TestLightningNodeSigVerification to versioned testby Elle Mouton · a9c9e765 · Apr 7, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

graph/db: convert TestLightningNodeSigVerification to versioned test

Rename to testLightningNodeSigVerification and add it to the
versionedTests table so it runs against both v1 and v2. The signing
step is version-specific (ECDSA for v1, Schnorr for v2) while the
verification path is shared.

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 boundarydefensive validation
AI analysis · Informational 15/100

This commit only changes a test file. It renames an existing test and makes it run against two versions of the software's gossip protocol, adding Schnorr signature coverage for the newer version. There is no change to production code, so it does not introduce or fix a security vulnerability in the running software.

Lower-prioritygraph/db: convert TestNodePruningUpdateIndexDeletion to versioned testby Elle Mouton · f7b689d5 · Apr 7, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

graph/db: convert TestNodePruningUpdateIndexDeletion to versioned test

Rename to testNodePruningUpdateIndexDeletion and add it to the
versionedTests table so it runs against both v1 and v2 backends.

The NodeUpdateRange is now built per-version: time-based for v1
and block-height-based for v2.

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

This commit only changes a test file. It renames an existing test and makes it run against both database backends (v1 and v2) instead of just v1. The test checks that deleting a node from the network graph also removes it from an update index. There is no change to production code, no bug fix, and no security-relevant behavior change.

Lower-prioritysqldb/sqlc: remove old inflight query APIby yyforyongyu · 60d6b747 · Apr 7, 2026 · 4 filesMessage 78 · AdequateInformational 15Details
Commit message · yyforyongyu

sqldb/sqlc: remove old inflight query API

FetchInFlightPayments no longer relies on the old
FetchAllInflightAttempts query surface once the non-terminal payment
query is in place.

Use make lint and the inflight recovery tests as evidence. The code
still passes once the old query and its generated bindings are removed.

Remove FetchAllInflightAttempts from payments.sql, regenerate the sqlc
bindings, and drop the matching SQLQueries interface method.

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

This commit simply removes an unused database query and its generated code. It is a cleanup change with no security relevance.

Lower-prioritypaymentsdb: remove dead inflight helper codeby yyforyongyu · 95e447f2 · Apr 7, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · yyforyongyu

paymentsdb: remove dead inflight helper code

After removing the old FetchAllInflightAttempts query API, the helper
types that only existed to batch load that path are no longer used.

Use make lint as evidence. It reports the old inflight helper types as
unused once the query API is gone.

Remove the obsolete helper structs and batch-loading function from the
payment SQL store so the remaining code matches the new inflight
recovery path.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit simply deletes unused helper code from the payment database layer. No security issue is present; it is a routine cleanup that removes dead code reported by the linter after a previous API removal.

Lower-prioritypaymentsdb: use non-terminal payment query for recoveryby yyforyongyu · 96cbd4a7 · Apr 7, 2026 · 1 fileMessage 83 · StrongLow 30Details
Commit message · yyforyongyu

paymentsdb: use non-terminal payment query for recovery

The new FetchNonTerminalPayments query is available, but
FetchInFlightPayments still uses the old unresolved-attempt scan until
this commit.

Use the inflight recovery regression tests as evidence. They now pass
on both KV and SQL once the payment store is wired up to use the new
query.

Fix this by switching FetchInFlightPayments to the non-terminal
payment query and batch loading only the related attempt and route
data for those payment IDs.

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
fuzzing or regression evidence
AI analysis · Low 30/100

This commit fixes how LND's SQL payment store finds payments that are still in progress during startup recovery. Previously it scanned individual payment attempts that were still unresolved, which could miss or mishandle payments. Now it queries payments directly by their non-terminal status and loads only the related attempt data. The change is framed by the developer as fixing a regression in recovery behavior, with tests now passing on both database backends.

Lower-prioritysqldb/sqlc: add non-terminal payment queryby yyforyongyu · 4c163acf · Apr 7, 2026 · 5 filesMessage 78 · AdequateInformational 12Details
Commit message · yyforyongyu

sqldb/sqlc: add non-terminal payment query

FetchInFlightPayments needs a dedicated SQL query that can return
non-terminal payments without relying on the unresolved-attempt scan.
The first version of that query fixed correctness, but the follow-up
selector measurements showed a UNION-based shape was materially
faster while returning the same payment set.

Use the inflight regression tests as evidence. The tests still fail on
SQL before the Go payment store is wired up, but this commit adds the
final SQL surface the later wiring commit depends on.

Add FetchNonTerminalPayments to the SQL query set, regenerate the sqlc
bindings, add the PaymentAndIntent adapters for the new row type, and
use the UNION-based candidate selection so the final query shape lands
in one commit.

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

This commit adds a new database query to the Lightning Network Daemon (LND) for finding payments that haven't finished yet. It is a performance and correctness improvement to how the node tracks in-flight payments. There is no indication it fixes a security vulnerability or introduces a new attack path.

Lower-prioritypaymentsdb: add AMP hash regression testby yyforyongyu · e8c58fc0 · Apr 7, 2026 · 1 fileMessage 90 · StrongLow 41Details
Commit message · yyforyongyu

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.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Low 41/100

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.

Lower-prioritypaymentsdb: add inflight recovery regression testsby yyforyongyu · 5d9756f8 · Apr 7, 2026 · 1 fileMessage 83 · StrongLow 37Details
Commit message · yyforyongyu

paymentsdb: add inflight recovery regression tests

SQL FetchInFlightPayments only returns payments with an unresolved
attempt row. KV returns every non-terminal payment, including
retryable payments with only failed attempts and payments that have
been initialized but have not registered any HTLCs yet.

Add TestFetchInFlightPaymentsIncludesRetryablePayments and
TestFetchInFlightPaymentsIncludesInitiatedPayments as evidence. Both
tests pass on KV and fail on SQL before the fix.

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
fuzzing or regression evidence
AI analysis · Low 37/100

This commit only adds new regression tests to LND's payment database. The tests document that the SQL database backend previously failed to return certain kinds of non-finished (retryable or just-started) payments when asked for in-flight payments, while the older KV backend returned them correctly. The commit itself does not contain the actual fix; it only adds tests that would have failed before the fix. The practical risk is that recovery or routing logic relying on FetchInFlightPayments could miss payments it should retry or monitor, but no direct funds-loss vulnerability is shown in the diff.

Lower-prioritypaymentsdb: preserve AMP attempt hashes in sql storeby yyforyongyu · 53eea4d0 · Apr 7, 2026 · 1 fileMessage 95 · StrongLow 43Details
Commit message · yyforyongyu

paymentsdb: preserve AMP attempt hashes in sql store

Live SQL writes stored the payment identifier in payment_hash for
each attempt. That works for legacy payments, but it breaks AMP
because the payment identifier is the SetID while each shard carries
its own HTLC hash.

Use TestRegisterAttemptPreservesAttemptHash as evidence. The test now
passes on both KV and SQL.

Fix this by persisting attempt.Hash when it is present and only
falling back to the payment identifier when the attempt hash is nil.
That restores KV parity for AMP attempt reloads.

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 · Low 43/100

This commit fixes a database bug in LND's new SQL payment store. For a special payment type called AMP (Atomic Multi-Path), each individual payment shard has its own unique hash, but the SQL store was incorrectly saving the overall payment identifier (the SetID) as the hash for every shard. This meant that when LND later reloaded AMP payment attempts from the SQL database, the per-shard hashes were wrong, which could break retry logic, correlation of HTLCs, or reporting. The fix saves the shard's own hash when available, and only falls back to the payment identifier when there is no shard hash. It is a data-integrity bug, not a direct funds-loss vulnerability, and only affects users running the experimental SQL backend.

Lower-prioritychainreg: accommodate buried taproot deployment in Bitcoin Core v31by Matthew Zipkin · f8314761 · Apr 6, 2026 · 1 fileMessage 81 · StrongLow 37Details
Commit message · Matthew Zipkin

chainreg: accommodate buried taproot deployment in Bitcoin Core v31

Removes "taproot" from deployments:
https://github.com/bitcoin/bitcoin/pull/26201

Adds "script_flags" field to RPC getdeploymentinfo:
https://github.com/bitcoin/bitcoin/pull/32998

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Low 37/100

This change updates LND's compatibility check so it can still recognize that Bitcoin Core supports Taproot after Bitcoin Core version 31 removed Taproot from its deployment list and added a new 'script_flags' field. Without this fix, LND might incorrectly think a fully capable Bitcoin Core backend does not support Taproot, potentially causing startup or feature-detection problems. It is a robustness fix, not a vulnerability patch.

Lower-prioritydocs: add release note for cursor-based invoice paginationby ziggie · 85c8e955 · Apr 1, 2026 · 1 fileMessage 62 · AdequateInformational 15Details
Commit message · ziggie

docs: add release note for cursor-based invoice pagination

62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit only adds a release note describing a previous performance improvement: invoice database queries were changed from slow offset-based pagination to faster cursor-based pagination. There is no code change, no bug fix, and no security relevance in the commit itself.

Lower-priorityinvoices+sqldb/sqlc: replace offset-based pagination with cursor-basedby ziggie · e02f77ec · Apr 1, 2026 · 4 filesMessage 85 · StrongLow 27Details
Commit message · ziggie

invoices+sqldb/sqlc: replace offset-based pagination with cursor-based

The invoice filter queries (FetchPendingInvoices,
FilterInvoicesBySettleIndex, FilterInvoicesByAddIndex,
FilterInvoicesForward, FilterInvoicesReverse) all used LIMIT+OFFSET for
internal pagination. This causes SQLite to build an ephemeral temp
B-tree for every page to implement the OFFSET skip, making each
successive page O(offset+limit). On nodes with large invoice histories
this compounds into a significant CPU cost — profiling showed
FilterInvoicesReverse consuming 53% of total CPU, with _sqlite3BtreeInsert
and _balance_nonroot (2.4s combined) appearing inside the SELECT due to
the temp B-tree being built and rebalanced to skip rows.

Replace the OFFSET loop (queryWithLimit) with cursor-based pagination
across all four callers in sql_store.go:

- FetchPendingInvoices: add id_cursor param, advance cursor to
last_id + 1 each page.
- InvoicesSettledSince: add id_cursor param alongside the existing
settle_index lower bound, advance cursor to last_id + 1 each page.
- InvoicesAddedSince: cursor starts at idx+1, advances to last_id+1.
- QueryInvoices: forward cursor starts at IndexOffset+1 and advances
by +1; reverse cursor starts at IndexOffset-1 (or MaxInt64) and
advances by -1. Inclusive SQL bounds (>= / <=) are preserved so
query semantics and all existing callers are unchanged.

The queryWithLimit helper is removed as it has no remaining callers.

Each page now performs a single PK seek + forward scan of exactly
page_size rows with no temp sort structure, matching the cursor-based
pattern already used by the payments filter queries.

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 27/100

This commit is a performance optimization, not a security fix. It replaces slow database pagination that skipped rows using OFFSET with faster cursor-based pagination using primary-key ranges. On nodes with very large invoice histories this can dramatically reduce CPU usage and query time, but it does not close any vulnerability that an attacker could exploit.

Lower-prioritysqldb/v2: limit MigrationExecutor interfaceby Viktor Torstensson · 1b3bea56 · Mar 31, 2026 · 5 filesMessage 90 · StrongInformational 14Details
Commit message · Viktor Torstensson

sqldb/v2: limit MigrationExecutor interface

This commit limits the MigrationExecutor interface due to the following
reasoning:

1. SkipMigrations() and DefaultTarget() should not be on the interface
Both are only used by ApplyAllMigrations, which immediately passes the
results back into the same executor. They are internal implementation
details and should be folded into ExecuteMigrations itself.

2. SetSchemaVersion and GetSchemaVersion are test-only but on the
production interface Every caller of these in sqldb/v2 is in test files.
The SetSchemaVersion comment even says "USE WITH CAUTION" — dangerous
test utilities should not be on an interface that every real consumer
must implement. They should be accessible on the concrete types only and
used directly in tests without going through the interface.

3. ExecuteMigrations should not take a MigrationTarget parameter for the
normal path On the normal startup path, callers just do
executor.ExecuteMigrations(executor.DefaultTarget(), stream) — asking
the executor for its default and handing it straight back. The method
should run to latest by default; a version override for tests can live
on the concrete type instead.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Informational 14/100

This commit is a routine code cleanup in LND's database migration system. It narrows a Go interface so that production code only exposes the migration method actually needed at runtime, while test-only helpers move to the concrete database types. There is no security-relevant change: no bug is fixed, no vulnerability is introduced, and no behavior of the running program changes.

Lower-prioritysqldb/v2: rename the `postgresErrMsgs` listby Viktor Torstensson · 4219e5ae · Mar 31, 2026 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Viktor Torstensson

sqldb/v2: rename the `postgresErrMsgs` list

Rename the `postgresErrMsgs` list to `postgresRetriableErrMsgs`, in
order to clarify its usage.

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

This commit is a simple rename of an internal variable and its comment from `postgresErrMsgs` to `postgresRetriableErrMsgs`. No code behavior changes; it only improves readability. There is no security relevance.

Lower-prioritysqldb/v2: use `defaultMaxIdleConns` in SqliteStoreby Viktor Torstensson · 0c8f5211 · Mar 31, 2026 · 1 fileMessage 73 · AdequateInformational 19Details
Commit message · Viktor Torstensson

sqldb/v2: use `defaultMaxIdleConns` in SqliteStore

The code previously used `defaultMaxOpenConns` for both the maximum
number of open connections and the maximum number of idle connections in
the `SqliteStore`.

This commit updates the code to use `defaultMaxIdleConns` for the
maximum number of idle connections.

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

This commit fixes a small configuration mistake in LND's SQLite database setup. Previously, the code used the same limit for both 'open' and 'idle' database connections, when it should have used separate limits. This is a code-quality and reliability fix, not a security vulnerability. It does not allow attackers to steal funds, access data, or crash the node directly.

Lower-prioritysqldb/v2: ensure SqliteConfig.MaxConnections is usedby Viktor Torstensson · 58f757a8 · Mar 31, 2026 · 1 fileMessage 50 · ThinInformational 17Details
Commit message · Viktor Torstensson

sqldb/v2: ensure SqliteConfig.MaxConnections is used

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

This commit fixes a small configuration bug in LND's SQLite database setup. Previously, the user-supplied 'MaxConnections' setting was ignored and a hardcoded default was always used. Now the configured value is respected if it is greater than zero. This is a correctness fix rather than a clear security vulnerability, though ignoring a connection limit could theoretically contribute to resource exhaustion under unusual conditions.

Lower-prioritysqldb/v2: clarify config options docsby Viktor Torstensson · 1819b986 · Mar 31, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Viktor Torstensson

sqldb/v2: clarify config options docs

The documentation for the `SqliteConfig.MaxConnections`,
`PostgresConfig.MaxOpenConnections` and
`PostgresConfig.MaxIdleConnections` previously stated that an unlimited
number was used when the value was set to 0. This is not the case
however, as setting the value to 0 will result in the default values
being used.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit only fixes three incorrect sentences in the user-facing documentation for database connection settings. It does not change any code behavior, defaults, or limits. There is no security issue in the commit itself.

Lower-prioritysqldb/v2: rename `ErrRetriesExceeded` errorby Viktor Torstensson · a726dbd0 · Mar 31, 2026 · 3 filesMessage 60 · AdequateInformational 15Details
Commit message · Viktor Torstensson

sqldb/v2: rename `ErrRetriesExceeded` error

rename the `ErrRetriesExceeded` error to `ErrTxRetriesExceeded`.

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

This commit simply renames an internal error variable from ErrRetriesExceeded to ErrTxRetriesExceeded across three files. The error message text and behavior remain unchanged. There is no security relevance.