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

Security candidatelnwallet: prevent transaction pagination overflowby Ziggie · 62aeca57 · Aug 14, 2026 · 2 filesMessage 50 · ThinLow 40Details
Commit message · Ziggie

lnwallet: prevent transaction pagination overflow

50/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
memory safetysigning or wallet path
AI analysis · Low 40/100

This commit fixes a pagination bug in LND's wallet transaction listing. Previously, adding a user-controlled 'offset' and 'limit' together as 32-bit unsigned integers could wrap around to a tiny number, causing the code to slice transaction data using an unexpectedly small 'end' index and potentially return wrong results or behave inconsistently. The fix performs pagination using 64-bit arithmetic and compares the limit against the remaining items before deciding where to stop, preventing the overflow.

Security candidatelnwallet: require an aux sig per HTLC on taproot overlay channelsby George Tsagkarelis · 4b564f1f · Aug 13, 2026 · 2 filesMessage 88 · StrongHigh 74Details
Commit message · George Tsagkarelis

lnwallet: require an aux sig per HTLC on taproot overlay channels

The aux signature blob is peer supplied and carries no count of its own.
Verification jobs were only built for HTLCs an entry was received for,
so a peer could withhold the aux signature for an HTLC simply by
omitting it: no job was produced, nothing reported the omission, and the
commitment became our state carrying a signature we never received. At
force close the resolver then reads an empty signature out of that
HTLC's custom records, and the second level HTLC cannot be swept.

An aux signer emits exactly one entry per non-dust HTLC, in lockstep
with the BTC level signatures, so the count is now checked the same way
those already are, right beside them.

The check is gated on the tapscript root bit rather than merely on an
aux signer being configured. The signer is attached node wide, so it is
also present on plain channels, whose peers correctly send no aux
signatures at all, and requiring them there would force close those
channels. That bit is set at funding time if and only if the negotiated
commitment type is a taproot overlay, so it names exactly the channels
whose peers owe us aux signatures.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarydefensive validationsigning or wallet path
AI analysis · High 74/100

This commit fixes a bug in LND's taproot overlay Lightning channels where a peer could deliberately leave out an extra signature (aux sig) for one or more HTLCs. Because the code only checked the main Bitcoin signatures, the missing aux signature went unnoticed. Later, if the channel was force-closed, the affected HTLC could not be swept on-chain, potentially locking up funds. The fix adds a count check so that every non-dust HTLC must have a matching aux signature on taproot overlay channels.

Security candidatelnwallet: model the aux sig blob faithfully in testsby George Tsagkarelis · 80f7fd88 · Aug 13, 2026 · 3 filesMessage 88 · StrongLow 26Details
Commit message · George Tsagkarelis

lnwallet: model the aux sig blob faithfully in tests

Three places modelled the aux signature blob less faithfully than
production does, in ways that hid whether the blob was carried at all.

MockAuxSigner.UnpackSigs returned a single slot no matter how many HTLCs
were packed. A real aux signer emits exactly one slot per HTLC, and code
that pairs the unpacked slots with HTLCs by index depends on that. The
default mock now records the slot count in the packed blob and hands
back that many slots. Since the blob is parsed into custom records, it
has to stay a canonical TLV stream, so the count travels in the dummy
record's value. Registering a function rather than a fixed value is what
lets the result depend on the input.

restartChannel rebuilt the channel with no channel options, so a restart
silently dropped the aux signer and the restarted side stopped producing
aux signatures while its peer still expected them. Production re-applies
the aux components every time a channel is loaded.

Two chan sync tests rebuilt CommitSigs from a retransmitted wire message
without its aux signature blob, which the link carries across.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarysigning or wallet path
AI analysis · Low 26/100

This commit fixes test code in LND's Lightning wallet so that mock auxiliary (taproot/asset channel) signatures behave more like the real production code. The changes make tests correctly preserve the aux signer across channel restarts and carry the aux signature blob through retransmitted commitment messages. There is no direct production code change; it is a test-harness hardening patch that prevents future bugs in the aux-signature protocol from being hidden by inaccurate test mocks.

Security candidatedocs: update release notesby bitromortac · 9cfd5a66 · Aug 11, 2026 · 1 fileMessage 67 · AdequateInformational 15Details
Commit message · bitromortac

docs: update release notes

Add changes for the Merkle tree and BIP-340 signature work in bolt12.

67/100 · AdequateMessage clarity
✓ Descriptive subject✓ Uses a recognizable type or scope✓ Provides an explanatory body✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarydocumentation-only discount
AI analysis · Informational 15/100

This commit only updates the release notes document. It adds two bullet points describing earlier work on BOLT 12 Merkle trees and BIP-340 signatures, plus related test vectors. No code, logic, or configuration was changed, so it cannot introduce or fix a security issue by itself.

Security candidateMerge pull request #11023 from ellemouton/update-fee-logby Yong · 7f56541d · Aug 7, 2026 · 8 filesMessage 73 · AdequateModerate 59Details
Commit message · Yong

Merge pull request #11023 from ellemouton/update-fee-log

lnwallet+htlcswitch: align update_fee handling with BOLT 2

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
signing or wallet pathboot or update pathmerge-commit duplicate discount
AI analysis · Moderate 59/100

This commit hardens how LND handles Lightning channel fee updates and mailbox message admission. It enforces the protocol rule that only the channel opener can send fee updates, prevents uncommitted fee updates from piling up in the update log, limits how many queued messages a peer can stuff into a channel's mailbox, and makes the link disconnect if the mailbox is full so messages are not silently dropped. These changes reduce ways a misbehaving or buggy peer could disrupt a channel or waste resources.

Security candidatebolt12: add BIP-340 message signaturesby bitromortac · dfdcd507 · Aug 6, 2026 · 3 filesMessage 83 · StrongInformational 14Details
Commit message · bitromortac

bolt12: add BIP-340 message signatures

SignMessage and VerifySignature wrap btcec's Schnorr API around the
Merkle root with the spec's tagged-hash domain separator. Typed
helpers bind the construction to invoice requests and invoices, so
callers sign and verify messages rather than raw roots.

The signed vectors in signature-test.json verify the construction
against the spec, and a tamper matrix pins rejection of modified
roots, signatures, keys, and tags.

83/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarysigning or wallet path
AI analysis · Informational 14/100

This commit adds new code for creating and checking digital signatures on BOLT 12 lightning invoices and invoice requests. It is a feature addition with extensive tests, not a fix for a known security bug. There is no evidence in the commit or supplied references that it addresses a vulnerability.

AI review queuedlnwallet: complete missing reservationsby yyforyongyu · 8bf173e5 · Aug 6, 2026 · 2 filesMessage 68 · AdequateLow 32Details
Commit message · yyforyongyu

lnwallet: complete missing reservations

Return both completion results when the reservation is no longer
present.

Add a focused regression test for the missing-reservation response.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidencesigning or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 32/100

This commit fixes a small but real bug in LND's channel-funding code. When a funding request referred to a reservation that no longer existed, the code sent an error message but forgot to send the matching 'completion' signal. A caller waiting on both channels could hang or misbehave. The fix adds the missing completion signal and includes a regression test. There is no claim in the commit that this is a security issue, but incomplete error handling in wallet code can sometimes be abused to cause denial of service.

Security candidatecontractcourt: match second-level outputsby yyforyongyu · dd24c85c · Aug 6, 2026 · 2 filesMessage 73 · AdequateModerate 57Details
Commit message · yyforyongyu

contractcourt: match second-level outputs

A re-signed success transaction can move its committed output to another
index while preserving the HTLC input signature.

Match the indexed output against the sweep descriptor and return the
confirmed outpoint. Keep malformed resolver and notifier state distinct
from complete non-matches.

73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Moderate 57/100

This commit adds logic to LND's contract court so that when an incoming HTLC is claimed on-chain via a re-signed success transaction, the resolver correctly identifies which output of that transaction it should sweep next. Previously, the code may have relied on a fixed output index; now it checks the actual output at the same index as the HTLC input and verifies it matches the expected sweep descriptor. The change is defensive and includes tests, but the commit message frames it as fixing a real correctness issue that could affect fund recovery.

AI review queuedMerge pull request #11019 from Roasbeef/coop-close-race-publicby Yong · f4ae5656 · Aug 6, 2026 · 9 filesMessage 73 · AdequateModerate 57Details
Commit message · Yong

Merge pull request #11019 from Roasbeef/coop-close-race-public

lnwallet/chancloser: fix data race in the legacy coop close state machine

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
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 57/100

This update fixes two related problems in LND's cooperative channel-closing code. First, it eliminates a data race where the same state machine was being advanced by two different internal goroutines at once, which could cause crashes or inconsistent close negotiations. Second, it now always checks that the other party's payout address is well-formed and safe to pay, instead of only checking when an upfront shutdown address was already on file. Previously, a malformed or malicious address could slip through in some cases.

Security candidateMerge pull request #11024 from ziggie1984/invoices-update-validationby ziggieXXX · 61f3b5a7 · Aug 5, 2026 · 4 filesMessage 58 · ThinModerate 63Details
Commit message · ziggieXXX

Merge pull request #11024 from ziggie1984/invoices-update-validation

invoices: refine update handling

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
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 63/100

This commit tightens how LND processes invoice payments, especially for newer multi-path (MPP) and AMP invoices, keysend payments, and replayed payments. It adds checks that ensure the right payment preimage is used for each invoice type and that AMP invoices cannot be processed through the older legacy path. The changes are defensive hardening rather than a single obvious exploit fix, but they close several paths where an attacker might trick LND into settling an invoice incorrectly or using the wrong secret.

Security candidateinvoices: refine update handlingby ziggie · 6be6350e · Aug 5, 2026 · 3 filesMessage 35 · OpaqueModerate 59Details
Commit message · ziggie

invoices: refine update handling

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
boot or update path
AI analysis · Moderate 59/100

This commit tightens how LND handles invoice payment updates, especially for newer 'AMP' invoices and old-style 'keysend' payments. It adds checks so that the wrong kind of payment cannot be processed against the wrong kind of invoice, and it verifies that stored payment secrets actually match the expected hash. The changes are defensive: they reject mismatched or malformed payments instead of allowing them to proceed. The commit does not say it fixes a known exploit, but the new checks close paths where a payment might have been accepted incorrectly.

Lower-prioritydocs: update 0.21.2 release notesby ziggie · 758bbb8e · Aug 5, 2026 · 1 fileMessage 57 · ThinInformational 15Details
Commit message · ziggie

docs: update 0.21.2 release notes

57/100 · ThinMessage clarity
✓ 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 updates the release notes document for version 0.21.2. It adds a bullet point describing a previously merged code change about invoice handling and adds a contributor name to the credits list. No actual code was changed, so this commit itself does not fix or introduce any security issue.

Security candidatepeer+lnwallet/chancloser: advance the legacy closer from one goroutineby Olaoluwa Osuntokun · e5e134dd · Aug 4, 2026 · 4 filesMessage 88 · StrongModerate 60Details
Commit message · Olaoluwa Osuntokun

peer+lnwallet/chancloser: advance the legacy closer from one goroutine

In this commit, we give the legacy ChanCloser a single owner, rather than
letting two goroutines advance it. The peer's channelManager drives the state
machine for the Shutdown and ClosingSigned messages that come off the wire, and
for local close requests. The link drives it as well: while we wait for the
channel to drain we register a flush hook, and the link invokes that hook from
its own goroutine, where it called BeginNegotiation directly. Nothing kept the
two apart, so the state field, the priorFeeOffers map, and the signing step
could all be touched at once. Under `go test -race` this shows up as a data race
on the state field.

Rather than reach for a lock, we route the flush through the channelManager. The
hook now only reports the channel ID over a new chanCloseFlushed channel, and
handleChanFlushed picks it up next to the close messages. Every transition, the
cached offer processing, the fee map, and the signing then happen on the one
goroutine, so the closer needs no synchronization of its own. We spell that out
on the type, since it's an invariant a new caller can break from the outside.

The report goes out from a fresh goroutine, which matters more than it looks.
The link may well be holding its own lock while it invokes the hook, and
channelManager reaches for that same lock in DisableAdds, so blocking on the
handoff would trade the race for a deadlock. The `go` in front of RemoveLink
just above it is there for the same reason.

We look the closer up with a plain map load rather than through
fetchActiveChanCloser, as that one builds a fresh closer when it doesn't find
an existing one, and a flush that lands after the negotiation was torn down has
no business starting a new negotiation.

One behavior change falls out of the move: the flush path now runs the same
finalization tail as the message path. It skipped that before, so a responder
that drained a cached offer would reach closeFinished and broadcast, but nothing
ran finalizeChanClosure until the next close message showed up, and having
already sent its final signature, there may not be one. The link == nil path
already ran the tail, so this makes all three paths agree.

The new test drives a close with a link that hands us the flush hook instead of
running it inline, so we can check that negotiation waits on the report, and
that a report for a channel we have no closer for is dropped.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarysigning or wallet path
AI analysis · Moderate 60/100

This commit fixes a concurrency bug in how LND negotiates cooperative channel closures. Previously, two different goroutines could update the same channel-closing state machine at the same time, which could corrupt internal data or cause a crash. The fix routes all updates through a single goroutine and adds a test to confirm the behavior.

AI review queuedlnwallet/chancloser: record the remote close output only when acceptedby Olaoluwa Osuntokun · fb89732d · Aug 4, 2026 · 1 fileMessage 73 · AdequateLow 29Details
Commit message · Olaoluwa Osuntokun

lnwallet/chancloser: record the remote close output only when accepted

In this commit, we hold off on recording the remote party's close output until
we've decided we can act on their Shutdown. ReceiveShutdown wrote the field
before it looked at the state, so a Shutdown that arrives at a point where we
have nothing to do with it, say once we've already finished the negotiation,
would still overwrite the output we settled on before being turned away with
ErrInvalidState. The output we report for the close then describes a message we
rejected.

Nothing acts on this today, as we hand the outputs to the caller only after
ClosingTx tells it the negotiation finished, but the field is what we report to
the party that asked for the close, so we may as well only fill it in from a
message we accepted.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 29/100

This change fixes a bookkeeping bug in how LND records the other party's preferred closing address during a channel close. Previously, a late or unexpected Shutdown message could overwrite the correct address with one from a message that was rejected. The fix only saves the address when the message is actually accepted. The bug currently has no downstream effect because the recorded value is not used until after negotiation finishes, but it makes the close record more accurate.

Security candidatehtlcswitch: bound peer-controlled channel ingressby Elle Mouton · ef24f2c5 · Aug 4, 2026 · 4 filesMessage 68 · AdequateHigh 72Details
Commit message · Elle Mouton

htlcswitch: bound peer-controlled channel ingress

In this commit, we bound the channel mailbox by message count and by the
encoded size of non-commitment control messages. Commitment updates retain
their full custom-record allowance and remain protected by the count bound.
If either budget fills, we disconnect the peer instead of silently dropping
an ordered channel message.

We also reject unauthorized fee updates before fee-exposure evaluation,
return the exposure error used to fail the link, and emit peer-controlled
warning classes only once per link lifetime.

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 · High 72/100

This commit hardens LND's channel message handling against a peer that tries to overwhelm the node. It adds limits on how many ordered messages and how much data a peer can queue up for a channel, and it disconnects the peer if either limit is exceeded instead of silently dropping messages. It also fixes a protocol rule: only the channel initiator is allowed to send fee updates, so the node now rejects fee updates from the wrong side before doing any math on them. Finally, it reduces log spam by recording certain peer warnings and unknown messages only once per channel lifetime.

AI review queuedlnwallet/chancloser: validate delivery scripts in the RBF closerby Olaoluwa Osuntokun · a8e2a0f7 · Aug 4, 2026 · 2 filesMessage 83 · StrongModerate 64Details
Commit message · Olaoluwa Osuntokun

lnwallet/chancloser: validate delivery scripts in the RBF closer

In this commit, we make the RBF co-op closer validate the remote party's
delivery script in all cases, matching what the negotiation closer already does.
Previously we only ran the check when we had an upfront shutdown script on record
for the peer, so a peer that never committed to an upfront script could hand us a
delivery script that we'd stash and carry through the rest of the close flow
without ever looking at it.

We now always call validateShutdownScript with the (possibly nil) upfront
script: a nil upfront script still runs the well-formedness check on the peer's
script, and a non-nil one additionally enforces the exact match, same as before.
We also require the script to be present. The wire format puts no lower bound on
the address length, and validateShutdownScript treats an absent peer script as
nothing to check, so an empty one passed validation by default rather than on its
merits. Both entry points now go through one helper that insists on a script
before running the usual checks over it, which also covers a CloserScript
swapped in mid-negotiation via ClosingComplete rather than letting that one go
unchecked.

The delivery-form coverage is spelled out in the tests: the spec dropped p2pkh
and p2sh for co-op closes to keep the dust calculations uniform, and we don't
implement the OP_RETURN form that option_simple_close allows, so all of those are
rejected along with an empty or malformed script.

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
defensive validationsigning or wallet pathsecond-pass: near security thresholdsecond-pass: security-sensitive path
AI analysis · Moderate 64/100

This commit fixes a bug in LND's cooperative channel-closing code where a peer could supply an invalid, empty, or even money-burning Bitcoin address during a close, and LND would accept it without checking. The fix makes the newer 'RBF' closer always validate the peer's payout address, matching what the older negotiation closer already did. Before, validation only happened if the peer had previously committed to a specific upfront address. Without that, a malicious or buggy peer could have caused funds to be sent to an unspendable or malformed script.

AI review queuedlnwallet: make DustLimitForSize total over the sizes it can be handedby Olaoluwa Osuntokun · f80f92dc · Aug 3, 2026 · 2 filesMessage 73 · AdequateModerate 51Details
Commit message · Olaoluwa Osuntokun

lnwallet: make DustLimitForSize total over the sizes it can be handed

In this commit, we have DustLimitForSize fall back to the generic witness dust
threshold for any script size that doesn't match one of the well-known
templates.

The size switch covered P2WPKH, P2WSH, P2SH, P2PKH, and the explicit
unknown-witness size, and treated every other length as unreachable. That's a
narrower assumption than the callers can actually make good on: a witness
program for versions 1 through 16 carries a program of anywhere from 2 to 40
bytes, so its serialized length won't always land on one of those exact values.

The dust calculation only needs a representative output of roughly the right
shape, and the unknown-witness pricing is the conservative choice among the
ones we have, so we make it the default. That leaves the helper well defined
across the whole range of sizes callers can pass it, including scripts carrying
witness versions we don't know about yet.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Moderate 51/100

This change removes a deliberate program crash (panic) in LND's fee/dust-limit helper and replaces it with a safe fallback. Previously, if the helper received a script length it didn't explicitly recognize, it would panic and potentially crash the node. Now it treats any unrecognized length as a generic witness output and returns a dust value instead. The patch is defensive: it makes the code well-defined for future Bitcoin witness versions and arbitrary script sizes, but the commit message does not frame it as fixing a known exploitable vulnerability.

Lower-prioritydocs: move gossip bounds note to v0.21.2by ziggie · 83e7eb8c · Aug 3, 2026 · 2 filesMessage 57 · ThinInformational 15Details
Commit message · ziggie

docs: move gossip bounds note to v0.21.2

57/100 · ThinMessage clarity
✓ 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 moves an existing release-note entry from one version's notes (v0.22.0) to another (v0.21.2). It does not change any code, build files, configuration, or tests. The change is purely editorial documentation bookkeeping.

Lower-prioritydiscovery: bound channel range reply bufferingby Olaoluwa Osuntokun · ceff94fa · Jul 30, 2026 · 3 filesMessage 68 · AdequateHigh 72Details
Commit message · Olaoluwa Osuntokun

discovery: bound channel range reply buffering

In this commit, we cap each QueryChannelRange response at 100,000 SCIDs
across all streamed replies. The existing reply-count limit did not track
the aggregate decoded working set, so memory use varied with the encoding
and composition of the reply stream.

We count raw SCIDs before timestamp filtering, charge replies using the
received encoding type, and release all accumulated range state on any
error. This bounds both memory and CPU work while still leaving headroom
above the current graph.

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

This change fixes a way a malicious or buggy peer could make an LND node use an unpredictable amount of memory while syncing the Lightning channel graph. Before the fix, the node only limited the size of one compressed reply message, but an attacker could send many replies or craft replies so the total number of channel IDs ballooned. The patch caps the total number of channel IDs per sync at 100,000 and makes sure the temporary buffer is freed immediately if anything goes wrong, so a peer cannot trap memory by deliberately causing an error.

Security candidatelnwallet: fix limboMtx/intentMtx lock order inversion in PsbtFundingVerifyby LNBiG · a9c794e0 · Jul 30, 2026 · 3 filesMessage 73 · AdequateCritical 85Details
Commit message · LNBiG

lnwallet: fix limboMtx/intentMtx lock order inversion in PsbtFundingVerify

PsbtFundingVerify acquired intentMtx and then limboMtx, while
handleFundingCancelRequest, which runs in the wallet's single requestHandler
goroutine, acquires the two in the opposite order. With PSBT or batch funding
both paths run concurrently, so the two goroutines can deadlock.

The consequences are severe and node wide: requestHandler is the only executor
of every ChannelReservation method, and those methods are unconditional round
trips with neither a timeout nor a quit escape. Once it is stuck, a peer
disconnect parks funding.Manager's resMtx forever in CancelPeerReservations,
and the next zombie sweeper tick kills reservationCoordinator on resMtx.RLock.
From that moment the node can neither open nor accept channels, freshly
confirmed channels are stuck in the channelReadySent opening state and are
never added to the graph nor announced, and no log line is emitted about any of
it. Only a restart recovers.

Look the channel reservation up, and release limboMtx, before acquiring
intentMtx, and document the required order on the mutex declaration.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundarysigning or wallet path
AI analysis · Critical 85/100

This commit fixes a classic deadlock bug in LND's wallet code. Two different code paths were acquiring the same two locks in opposite orders, which could cause the wallet's single request handler goroutine to freeze permanently. Once frozen, the node could no longer open or accept any Lightning channels, and newly confirmed channels would get stuck without being announced to the network. Only restarting the node would recover. The fix reorders the lock acquisition so both paths use the same order, and documents the rule.

Lower-prioritydocs: update release notesby bitromortac · f42b4298 · Jul 30, 2026 · 1 fileMessage 47 · ThinLow 33Details
Commit message · bitromortac

docs: update release notes

47/100 · ThinMessage clarity
✓ Descriptive subject✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Low 33/100

This commit updates the release notes for LND 0.21.2 to describe a fix for a bug in the HTLC interceptor RPC. The bug caused LND to fail to forward payments in blinded routes when the next hop was identified by node ID instead of channel ID. The release notes also warn RPC clients that a special sentinel value now appears in the outgoing_requested_chan_id field for these cases, so client code must be updated to avoid misclassifying forwards. The commit itself only changes documentation, not code.

Lower-priorityitest: cover blinded route next_node_id forwardingby bitromortac · da6a40c0 · Jul 30, 2026 · 2 filesMessage 83 · StrongInformational 14Details
Commit message · bitromortac

itest: cover blinded route next_node_id forwarding

Add integration tests for an lnd introduction node forwarding a blinded
payment whose non-final hops identify the next hop by node ID (next_node_id)
rather than a short channel ID, as produced by other implementations:

- testBlindedRouteNextNodeID: the outgoing channel is public.
- testBlindedRouteNextNodeIDPrivateChannel: the outgoing channel is
private, so the node ID resolves to an SCID alias.
- testBlindedRouteNextNodeIDRestart: the introduction node is restarted
while the HTLC is in flight, exercising forwarding-package replay and
re-decode of the node-ID blinded hop.

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

This commit only adds new integration tests for an existing feature in LND: forwarding blinded payments where the next hop is identified by node ID rather than channel ID. It does not change production code, fix a bug, or introduce any new functionality. There is no security issue in this commit itself.

Lower-prioritywitness beacon: report node-ID next hop to the on-chain HTLC interceptorby bitromortac · 9c4b8bfe · Jul 30, 2026 · 2 filesMessage 73 · AdequateLow 25Details
Commit message · bitromortac

witness beacon: report node-ID next hop to the on-chain HTLC interceptor

Extend the on-chain interceptor path in the witness beacon to expose a
node-ID next hop, mirroring the off-chain path. A node-ID next hop has no
outgoing channel of its own, so the beacon reports hop.Exit as the outgoing
channel (via ForwardingInfo.NextHopChannel().UnwrapOr) and the requested
next node's public key. The RPC boundary maps that to the NodeIDForwardSCID
sentinel so the forward is not misread as a final receive.

This is the requested next hop, not the channel eventually selected by
non-strict forwarding, so the beacon deliberately does not resolve it
against the circuit map.

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

This change fixes a reporting gap in LND's 'witness beacon,' a component that watches on-chain transactions and tells the HTLC interceptor where a payment should go next. Previously, when the next hop was identified by a node ID rather than a specific channel ID, the on-chain interceptor only reported an 'exit' channel and omitted the actual next node's public key. The patch makes the on-chain path mirror the off-chain path by also reporting the requested node's public key and using a special sentinel value so clients don't mistake the forward for a final payment delivery. It is best understood as a correctness/parity fix that prevents misrouting or misclassification of intercepted forwards.

Lower-priorityhtlcswitch: forward node-ID blinded hops via non-strict forwardingby bitromortac · dbc57040 · Jul 30, 2026 · 6 filesMessage 81 · StrongModerate 59Details
Commit message · bitromortac

htlcswitch: forward node-ID blinded hops via non-strict forwarding

Fixes lightningnetwork/lnd#10937: forward a blinded-route payment when the
recipient identifies the next hop by node ID rather than a short channel
ID. The htlcPacket carries the decoded next hop to the switch, whose
handlePacketAdd resolves the pubkey to the peer's links via getLinks() and
lets the existing non-strict forwarding logic load-balance across the
peer's channels.

outgoingChanID stays a ShortChannelID. It is the persisted CircuitKey and
is set to the selected channel after non-strict selection. The circular
route check filters candidate channels before selection.

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 · Moderate 59/100

This commit fixes a bug in LND's payment forwarding for 'blinded routes'—a privacy feature in the Lightning Network. Previously, if the next hop was identified by node ID rather than a specific channel ID, the payment could not be forwarded correctly. The change lets LND resolve the node ID to any active channel with that peer and load-balance across them. It also adds safeguards to avoid leaking private channel identifiers in error messages, which could otherwise reveal information about hidden channels.

Lower-priorityhtlcswitch+lnrpc: report node-ID next hop to the off-chain HTLC interceptorby bitromortac · 32373b76 · Jul 30, 2026 · 3 filesMessage 73 · AdequateInformational 19Details
Commit message · bitromortac

htlcswitch+lnrpc: report node-ID next hop to the off-chain HTLC interceptor

When the switch forwards a blinded hop identified by node ID, it has not
yet resolved a concrete outgoing channel at interception time. Expose the
next hop to the interceptor: InterceptedForward.Packet() reports the
packet's outgoing channel as-is (hop.Exit, since none is selected yet) and
carries the requested pubkey in OutgoingNodeID.

At the RPC boundary, forwardInterceptor.onIntercept maps a node-ID hop to
the reserved NodeIDForwardSCID sentinel in outgoing_requested_chan_id and
the pubkey in outgoing_requested_node_id, so a client switching on a zero
channel ID to detect the exit hop does not misread the forward as a final
receive. The sentinel is a wire-only concern, applied where the request is
built rather than in the switch's internal InterceptedPacket, which stays
truthful (OutgoingNodeID.IsSome() is the node-ID discriminator).

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

This change improves how the Lightning Network Daemon (LND) reports forwarding details to external plugins that inspect HTLCs (payment packets). For a new type of blinded route where the next hop is identified by node ID rather than a specific channel, the code now tells the plugin both the requested node public key and a special reserved channel ID marker. This prevents an external plugin from mistakenly thinking the payment has reached its final destination when it has not. It is a correctness and information-disclosure improvement, not a fix for an active exploit.