LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

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

186security candidates236second-pass queue1372AI analyses
162commits · 30 days
277commits · 60 days
643commits · 180 days
1422commits · 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
387Strong · 80–100
837Adequate · 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 Osuntokun29659235474
ziggie49922422265
Elle Mouton26832268167
Yong60926172
ziggieXXX50617170
George Tsagkarelis37335167
LNBiG111173
Jared Tobin909171
yyforyongyu1211574070
bitromortac731154071
Erick Cestari26726070
Suheb746074
Analysis record

Published AI watches

Last scanned 55 minutes ago

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
Informational 15 AI analysisMessage 92 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: fix the custom linter cache wiring for CI

This commit fixes the GitHub Actions CI setup for running a custom code linter. It makes sure Docker can read and write build caches correctly and that the built linter image is available for later steps. There is no user-facing security f…

6f665663by Olaoluwa Osuntokun+30−82 files
No security note in commit
Moderate 66 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11482 from Roasbeef/pub/unsigned-acked-wrap

This patch fixes a database bug in the Lightning Network Daemon (LND) where very long lists of unsigned, acknowledged channel updates could be silently truncated when saved to disk. Because the storage format used a 16-bit counter, lists l…

Integer truncation / wrap-around in serialization format (uint16 count)Silent data loss on restart due to undersized length fieldDefensive deserialization with count-modulo validation
7431093fby Olaoluwa Osuntokun+218−127 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.

Lower-priorityMerge pull request #11473 from litbot-9000/gateway-v072-shim-filterby Olaoluwa Osuntokun · 405fb66d · Nov 3, 2026 · 1 fileMessage 73 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

Merge pull request #11473 from litbot-9000/gateway-v072-shim-filter

ci: bump gateway to v0.7.2 and skip comments from non-members

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
documentation-only discountmerge-commit duplicate discount
Lower-priorityMerge pull request #11428 from ziggie1984/sweep-no-input-batchby ziggieXXX · edd3a70a · Nov 3, 2026 · 5 filesMessage 58 · ThinTriage 0Details
Commit message · ziggieXXX

Merge pull request #11428 from ziggie1984/sweep-no-input-batch

sweep: add per-input batching isolation

58/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
Why it was queued
merge-commit duplicate discount
Security candidateci: bump gateway to v0.7.2 and skip comments from non-membersby litbot-9000 · e46a7503 · Nov 2, 2026 · 1 fileMessage 85 · StrongLow 25Details
Commit message · litbot-9000

ci: bump gateway to v0.7.2 and skip comments from non-members

Bump the gateway-action and runtime pins to v0.7.2 together: the v0.7.2
runtime needs the job token that gateway-action v0.7.2 passes. The release
limits /gateway explain to maintainers and the PR author, authorizes every
command before any credential is loaded, and adds repeat guards for
explain (per finding) and check (per HEAD). Refused commands get no reply;
the reason is in the workflow log.

Also skip comments from anyone who is neither a repo/org member nor the PR
author, so they never boot a runner. The runtime still checks every
command's permission itself.

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

This commit updates a GitHub Actions workflow that runs an AI code-review assistant called 'gateway' on pull request comments. It adds a pre-filter so only repository members or the pull request author can trigger the workflow, and it upgrades the gateway software to a new version that checks permissions before loading any credentials. The change is defensive: it reduces the chance that an outsider could waste compute resources or interact with the review bot, and it makes credential handling stricter. There is no direct evidence in the commit of a past security breach.

Lower-priorityMerge pull request #11453 from yyforyongyu/task-etcd-deprecationby Yong · f8832ca7 · Nov 2, 2026 · 1 fileMessage 73 · AdequateTriage 0Details
Commit message · Yong

Merge pull request #11453 from yyforyongyu/task-etcd-deprecation

docs: announce etcd deprecation after v0.22

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
documentation-only discountmerge-commit duplicate discount
Lower-priorityrouterrpc: map stale htlc set failuresby ziggie · c9716a0f · Nov 2, 2026 · 2 filesMessage 78 · AdequateTriage 0Details
Commit message · ziggie

routerrpc: map stale htlc set failures

Map ResultHtlcSetExpiryTooSoon to the existing invoice expiry failure
detail so SubscribeHtlcEvents does not terminate when a stale MPP or AMP
set is rejected. Extend the mapping test to cover both expiry outcomes.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritydocs: note sweep rejection retriesby yyforyongyu · ca657797 · Nov 2, 2026 · 1 fileMessage 72 · AdequateTriage 0Details
Commit message · yyforyongyu

docs: note sweep rejection retries

Document the retry behavior and required Go 1.27.3 minimum.

72/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body
Why it was queued
documentation-only discount
Security candidatebuild: pin btcwallet rejection mappingsby yyforyongyu · 8a69c380 · Nov 2, 2026 · 2 filesMessage 88 · StrongLow 26Details
Commit message · yyforyongyu

build: pin btcwallet rejection mappings

Use btcwallet v0.18.1 for the rejection mappings from #1464. Its
maintenance base avoids #1452's Neutrino upgrade and keeps the
existing migration library and RPC generator versions.

https://github.com/btcsuite/btcwallet/pull/1464
https://github.com/btcsuite/btcwallet/pull/1452

88/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
access control
AI analysis · Low 26/100

This commit updates LND's dependency on btcwallet from a pre-release development snapshot to the stable v0.18.1 release. The commit message says the goal is to adopt new 'rejection mappings' from a btcwallet pull request while avoiding an unrelated Neutrino upgrade. The change itself only modifies Go module files (go.mod and go.sum); it does not contain any actual code changes. Whether this is a security fix depends entirely on what the referenced btcwallet pull request #1464 contains, which is not shown in the supplied materials.

Lower-priorityMerge pull request #11265 from starius/ots-upgradeby Yong · ffc68754 · Nov 2, 2026 · 1 fileMessage 58 · ThinTriage 0Details
Commit message · Yong

Merge pull request #11265 from starius/ots-upgrade

scripts: add upgrade-ots.py

58/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
Why it was queued
merge-commit duplicate discount
Security candidateinvoices: reject stale shards at set completionby ziggie · 3ba74925 · Nov 1, 2026 · 4 filesMessage 68 · AdequateModerate 62Details
Commit message · ziggie

invoices: reject stale shards at set completion

Revalidate every accepted MPP or AMP shard when a completing shard
arrives. If an existing shard no longer satisfies either CLTV delta,
cancel the accepted set, keep the invoice open, and reject the
completing shard without recording it.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validationboot or update path
AI analysis · Moderate 62/100

This change fixes a bug in how Lightning Network invoices handle multi-part payments (MPP/AMP). Previously, a payment shard accepted early could sit until the rest of the payment arrived. By then, its timeout might be too close to the current blockchain height to safely settle, yet the system would still complete the payment. Now, when the final shard arrives, every previously accepted shard is re-checked for a safe timeout. If any shard is too close to expiring, the whole payment set is cancelled, the invoice stays open, and the final shard is rejected. This prevents a situation where funds could be released for a payment that can no longer be claimed on-chain in time.

Security candidatescripts: make OTS output deterministic for identical inputsby Boris Nagaev · 147e2b03 · Oct 31, 2026 · 1 fileMessage 73 · AdequateInformational 18Details
Commit message · Boris Nagaev

scripts: make OTS output deterministic for identical inputs

Keep the original CLI, dependencies, output layout and uploader behavior.
Fix the OTS subprocess hash seed, locale and timezone so identical responses
are traversed consistently. Sort proofs and replacement commands, omit local
backend details and generation times, and normalize output permissions.

Keep relative pending ages and transient diagnostics on the terminal rather
than in comparable files. Preserve the pending-age exit status.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
credential or privilege state
AI analysis · Informational 18/100

This commit changes a release-maintenance helper script so that running it twice with the same inputs produces byte-for-byte identical output files. It removes timestamps, local backend details, and non-deterministic ordering from the generated artifacts, and fixes environment settings that could make the OpenTimestamps client behave differently on different machines. These are build/reproducibility hardening changes, not a fix for an exploitable vulnerability in the Lightning node itself.

Lower-prioritysqldb: query pending invoice outcomesby yyforyongyu · 37e57e1f · Oct 31, 2026 · 1 fileMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

sqldb: query pending invoice outcomes

Include ordinary settle-pending parents in pending invoice queries.
Discover pending HTLCs independently of parent state so later duplicate
payments on settled invoices remain recoverable after restart. Retain
canceled invoices with settled or failed released HTLCs during cleanup.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritysqldb: generate pending outcome queriesby yyforyongyu · 6bcd4576 · Oct 31, 2026 · 2 filesMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

sqldb: generate pending outcome queries

Regenerate the pending-parent predicates, terminal-parent child query
and released-history cleanup filter from the SQL source. Keep generated
query interfaces separate from their source and backend consumers.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Security candidateinvoices: persist ordinary HTLC outcomesby yyforyongyu · b0a3e8ae · Oct 31, 2026 · 5 filesMessage 68 · AdequateLow 39Details
Commit message · yyforyongyu

invoices: persist ordinary HTLC outcomes

Discover pending ordinary children across parent states and apply final
outcomes inside the existing invoice transaction. Recompute successful
value and assign the first settlement index once, preserving duplicates.

Reuse the KV scan and SQL query updater. Keep AMP metadata writes on
their existing add-time path and leave ordinary producers unchanged.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
boot or update path
AI analysis · Low 39/100

This commit changes how the Lightning Network Daemon (LND) records the final result of ordinary payment attempts (HTLCs) for invoices. It adds a way to find invoices whose child payments are still awaiting a final outcome, and applies those outcomes inside the existing invoice update process. The change is a correctness/robustness improvement rather than an obvious security fix, but it touches settlement accounting and state transitions, which are security-sensitive in a payment system.

Security candidatemulti: defer ordinary invoice settlementby yyforyongyu · 78c092be · Oct 31, 2026 · 15 filesMessage 68 · AdequateModerate 61Details
Commit message · yyforyongyu

multi: defer ordinary invoice settlement

Release ordinary, MPP and hold preimages into PENDING_SETTLE, then
assign final credit and the settlement index through recorded HTLC
outcomes. Recover pending children beneath terminal parents without
allocating another index; let recorded failures override channel
inference and retry channel-only completion while running.

Switch ordinary replay, preimage lookup, expiry, notifications and RPC
projection together. Preserve the parent’s AMP settlement mechanisms and
controls; AMP finality remains deferred. Reuse existing integration
invoice waits rather than adding another harness API.

Cover partial credit, all-failed cancellation, recovery races, transient
writes and pending RPC timestamps using the existing backend fixtures.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
boot or update path
AI analysis · Moderate 61/100

This commit changes how LND marks invoices as 'paid.' Previously, when a payment arrived, LND immediately marked the invoice as fully settled. Now, for ordinary, multi-part, and hold invoices, LND first releases the payment preimage to the peer but keeps the invoice in a new 'pending settle' state. It only flips the invoice to 'settled' once the underlying HTLC outcomes are recorded as final. AMP invoices keep their old behavior for now. The change is designed to prevent double-counting, incorrect settlement indexes, and premature credit allocation if a payment later fails or is replayed.

Lower-priorityinvoices: test final settlement accountingby yyforyongyu · a7b8923f · Oct 31, 2026 · 2 filesMessage 78 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: test final settlement accounting

Verify pending accounting and final credit through the actual invoice
backends. Keep notification suppression for a failed release without
duplicating query, replay or all-failed fixtures.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-priorityinvoices: test startup settlement recoveryby yyforyongyu · 595b7c30 · Oct 31, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: test startup settlement recovery

Recover pending duplicate children beneath an already-settled parent.
Check both discovery queries while preserving the original payment
credit and settlement index.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-priorityinvoices: test live settlement recoveryby yyforyongyu · bf25d406 · Oct 31, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: test live settlement recovery

Verify a single final event survives a transient invoice-write failure.
Reuse one periodic recovery fixture for empty and failed startup
evidence, retaining completion without another restart.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-priorityinvoices: test outcome evidence precedenceby yyforyongyu · 8c1256b0 · Oct 31, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: test outcome evidence precedence

Verify startup inference can establish final payment credit only when no
durable failure overrides it. Preserve pending work on a failed record
recheck and cover the record-during-scan regression.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-priorityhtlcswitch: deliver test finality eventsby yyforyongyu · 6d67dde0 · Oct 31, 2026 · 3 filesMessage 78 · AdequateTriage 0Details
Commit message · yyforyongyu

htlcswitch: deliver test finality events

Bridge final link notifications to the real test invoice registry so
ordinary payments can wait for finality when its producer is activated.
Use arranged mock.Mock source calls and stop the registry before its
expectation check and database cleanup.

Keep link payment assertions waiting for the final invoice state.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-priorityinvoices: supply final HTLC outcomesby yyforyongyu · f9954d03 · Oct 31, 2026 · 4 filesMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: supply final HTLC outcomes

Read recorded and channel-state outcomes through chanstate types. Inject
the existing final-outcome subscription so the invoice source lives
beside its consumer without importing concrete providers.

Require trustworthy snapshots for inference. Restored or data-loss
channels need recorded outcomes, including after closure. Read archived
status for closed candidates and leave outcomes unknown on read failure.
Abandoned incoming HTLCs still on a commitment remain pending.

An absent incoming HTLC only proves collection when its index precedes
the snapshot's next remote HTLC index. Leave unseen contracts pending on
both open and archived channels while retaining recorded outcomes.

Persist local data loss before dispatching an unknown tweakless remote
close, so archival retains the lost-state evidence. Abort on a failed
write and preserve legacy point-driven reestablishment ordering.

Cover these evidence boundaries alongside normal channel controls,
including recovery without reestablishment and failed status
persistence.

Remote-force-close inference additionally requires the remote commitment
to have seen the incoming HTLC, since its view can lag the local one.
Preserve pending outcomes when that payment evidence is missing.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritylnd: connect final invoice HTLC outcomesby yyforyongyu · 89e5fbd3 · Oct 31, 2026 · 2 filesMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

lnd: connect final invoice HTLC outcomes

Connect the invoice source to channel storage and final switch events.
Keep event conversion at the server boundary and retain cancellation
that joins the existing forwarding goroutine.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-priorityinvoices: reconcile ordinary HTLC outcomesby yyforyongyu · 4f4b819b · Oct 31, 2026 · 3 filesMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: reconcile ordinary HTLC outcomes

Track released ordinary circuits until their final outcomes can be
written through the invoice transaction. Retry missed events and writes
using the existing finalizer lifecycle and periodic reconciliation.

Re-read durable outcomes after channel inference so a concurrent
recorded failure wins over inferred success. Infer unresolved
channel-only outcomes after successful startup too, without an extra
worker or flag.

Keep only ordinary payment hashes in the pending map and use mock.Mock
for the controlled source fixture. AMP finality remains deferred.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritylnrpc: define ordinary invoice finalityby yyforyongyu · d15c4510 · Oct 31, 2026 · 1 fileMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

lnrpc: define ordinary invoice finality

Add pending invoice and HTLC states for ordinary payments. Distinguish
failed released HTLCs and expose the release decision without treating
knowledge of the preimage as evidence that it left the node.

Document complete collection and cancellation semantics so callers can
separate final credit, released failures and unreleased cancellations.
Keep AMP settlement outside the new finality guarantee.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritylnrpc: generate invoice finality typesby yyforyongyu · bb326c2a · Oct 31, 2026 · 4 filesMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

lnrpc: generate invoice finality types

Regenerate ordinary pending and failed HTLC states, release history and
crediting documentation from the canonical proto source. Include the
invoices subserver Swagger so REST clients see the same outcome
contract.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-priorityinvoices: add pending settlement statesby yyforyongyu · 81e94b1a · Oct 31, 2026 · 3 filesMessage 68 · AdequateTriage 0Details
Commit message · yyforyongyu

invoices: add pending settlement states

Represent ordinary invoices and HTLCs awaiting final settlement after
preimage release. Preserve AMP release-time settlement semantics.

Expose the existing final-outcome update shape and keep pending ordinary
parents discoverable during recovery, including the explicit state case.

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