build: pin configurable btcwallet output leases
What changed, and why it matters
This commit updates LND's dependency versions for btcwallet and wtxmgr to a newer upstream version that fixes a timing issue with 'output leases.' In plain terms, when LND temporarily reserves a coin (UTXO) for a transaction, it sets an expiration time. The bug being fixed is that a slow-to-confirm spend could have its reservation expire before the wallet records that the coin was actually spent. If a shallow blockchain reorganization then happens, the wallet might mistakenly think the coin is still available and select it again for a new transaction. This could lead to double-spending attempts or channel failures. The commit itself only changes version pins and linter settings; the actual code fix lives in the upstream btcwallet/wtxmgr libraries.
Verify that the pinned upstream commits (a960541f35ed) indeed contain the described wall-clock expiry fix and configurable-lease API. Review how LND configures lease durations now that the API is configurable, and ensure leases are set long enough to cover slow confirmation scenarios. Run integration tests covering shallow reorgs and slow confirmations. Consider adding a regression test in LND that exercises the lease-expiry edge case if one does not already exist.
Security signals we found
Dependency bump to include upstream lease-expiry fix
Commit message describes a reorg-related coin-selection exposure
Temporary linter pin suggests controlled, intentional dependency override
Fix concerns UTXO lease timing and double-spend exposure
Evidence from the diff
The commit bumps github.com/btcsuite/btcwallet from v0.18.0 to v0.18.1-0.20260903142755-a960541f35ed and github.com/btcsuite/btcwallet/wtxmgr from v1.6.0 to v1.6.1-0.20260903142755-a960541f35ed. The commit message explains that the new upstream commit contains a ‘configurable-lease API and its wall-clock expiry fix.’ Without the fix, a slowly confirming spend can outlive its timed lease before wtxmgr records the spend height. A later shallow reorg can then expose the input to coin selection. The .golangci.yml change adds these modules to a temporary allow-list for replace-local, indicating they are pinned intentionally. The diff does not show the actual upstream fix; it only pins the versions containing it.
Changed components
github.com/btcsuite/btcwalletgithub.com/btcsuite/btcwallet/wtxmgrLND wallet coin selection / UTXO leasingInspect captured patch +9 / −6
### .golangci.yml
@@ -172,6 +172,9 @@ linters:
- google.golang.org/protobuf
- github.com/lightningnetwork/lnd/sqldb
- github.com/lightningnetwork/lightning-onion
+ # Temporary pins for confirmation-controlled lease expiry.
+ - github.com/btcsuite/btcwallet
+ - github.com/btcsuite/btcwallet/wtxmgr
replace-local: true
gosec:
### go.mod
@@ -16,11 +16,11 @@ require (
github.com/btcsuite/btcd/wire/v2 v2.0.0
github.com/btcsuite/btclog v1.0.0
github.com/btcsuite/btclog/v2 v2.0.1-0.20250728225537-6090e87c6c5b
- github.com/btcsuite/btcwallet v0.18.0
+ github.com/btcsuite/btcwallet v0.18.1-0.20260903142755-a960541f35ed
github.com/btcsuite/btcwallet/wallet/txauthor v1.4.0
github.com/btcsuite/btcwallet/wallet/txrules v1.3.0
github.com/btcsuite/btcwallet/walletdb v1.6.0
- github.com/btcsuite/btcwallet/wtxmgr v1.6.0
+ github.com/btcsuite/btcwallet/wtxmgr v1.6.1-0.20260903142755-a960541f35ed
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
### go.sum
@@ -57,8 +57,8 @@ github.com/btcsuite/btclog v1.0.0 h1:sEkpKJMmfGiyZjADwEIgB1NSwMyfdD1FB8v6+w1T0Ns
github.com/btcsuite/btclog v1.0.0/go.mod h1:w7xnGOhwT3lmrS4H3b/D1XAXxvh+tbhUm8xeHN2y3TQ=
github.com/btcsuite/btclog/v2 v2.0.1-0.20250728225537-6090e87c6c5b h1:MQ+Q6sDy37V1wP1Yu79A5KqJutolqUGwA99UZWQDWZM=
github.com/btcsuite/btclog/v2 v2.0.1-0.20250728225537-6090e87c6c5b/go.mod h1:XItGUfVOxotJL8kkuk2Hj3EVow5KCugXl3wWfQ6K0AE=
-github.com/btcsuite/btcwallet v0.18.0 h1:VSRClNLT7NX0wmJEGALz3jOZRRjWPpUdp7VI1Akie1o=
-github.com/btcsuite/btcwallet v0.18.0/go.mod h1:1ZMc1EEskov+AKKv4kCMZqN8BwVh9rpXwEyxbeWy2A4=
+github.com/btcsuite/btcwallet v0.18.1-0.20260903142755-a960541f35ed h1:2nmty4a4/GIqP+II2NXU+O6yZyRO1wgaeIjCHIZTvv4=
+github.com/btcsuite/btcwallet v0.18.1-0.20260903142755-a960541f35ed/go.mod h1:IQrr6b13s0ZTaj9RlM/LhQ+Xvmo/gK86L9oGu2upIeQ=
github.com/btcsuite/btcwallet/wallet/txauthor v1.4.0 h1:oIkGj32YK1CvWaJGlVwZA1f+y/KVHkfrd2PoST0ZpQs=
github.com/btcsuite/btcwallet/wallet/txauthor v1.4.0/go.mod h1:sGrBjcqQ8UPexuRajFs72+o544CJn3Pavv/5H0VAWVk=
github.com/btcsuite/btcwallet/wallet/txrules v1.3.0 h1:D5aGMwWIxdqek3xEJs4eOdMoh6iga2EI2xSlaXCdnNo=
@@ -67,8 +67,8 @@ github.com/btcsuite/btcwallet/wallet/txsizes v1.3.0 h1:2W9qt0edMoX8crx0Wm4Cv+eAj
github.com/btcsuite/btcwallet/wallet/txsizes v1.3.0/go.mod h1:42aE6+LMZSSEisQAa15Xml25ncuJFfhCrkcpB5OmkZk=
github.com/btcsuite/btcwallet/walletdb v1.6.0 h1:Yund5XbdqFxNW7+R2Sxs02bMC5fMrmORj4GN8MV55no=
github.com/btcsuite/btcwallet/walletdb v1.6.0/go.mod h1:q9xif0Csp52GVb3l252BbHCuyiCnuEbrPWu/HAsvaYc=
-github.com/btcsuite/btcwallet/wtxmgr v1.6.0 h1:ivSSnYCD4Kb5yAMZVyBA1VMYABIFcopPEcmHCrRZXcE=
-github.com/btcsuite/btcwallet/wtxmgr v1.6.0/go.mod h1:Raor7IBIwHSIKE9Lr5o+R9rwX7sRMHU1zjxgEQgn9h8=
+github.com/btcsuite/btcwallet/wtxmgr v1.6.1-0.20260903142755-a960541f35ed h1:HhSbzqX5IJUlBehUY+HLAXM1At+QygEOq0FdLTC5DYY=
+github.com/btcsuite/btcwallet/wtxmgr v1.6.1-0.20260903142755-a960541f35ed/go.mod h1:Raor7IBIwHSIKE9Lr5o+R9rwX7sRMHU1zjxgEQgn9h8=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8/go.mod h1:tYvUd8KLhm/oXvUeSEs2VlLghFjQt9+ZaF9ghH0JNjc=Why this scored 60/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.