sqldb/v2: use `defaultMaxIdleConns` in SqliteStore
What changed, and why it matters
This commit fixes a small configuration mistake in LND's SQLite database setup. Previously, the code used the same limit for both 'open' and 'idle' database connections, when it should have used separate limits. This is a code-quality and reliability fix, not a security vulnerability. It does not allow attackers to steal funds, access data, or crash the node directly.
No security action required. Treat as a normal reliability/performance fix. Reviewers may verify that defaultMaxIdleConns is defined and reasonable.
Security signals we found
No security-relevant signals present in commit or diff
Change is a constant substitution for database connection pool tuning
Evidence from the diff
In sqldb/v2/sqlite.go, NewSqliteStore was calling db.SetMaxIdleConns(defaultMaxConns) instead of db.SetMaxIdleConns(defaultMaxIdleConns). The fix aligns the idle connection pool limit with its intended constant. This is a configuration bug that could affect connection pool behavior, but it is not an exploitable security flaw.
Changed components
sqldb/v2/sqlite.goSQLite connection pool configuration in LNDInspect captured patch +1 / −1
diff --git a/sqldb/v2/sqlite.go b/sqldb/v2/sqlite.go
index 335f099..4aa4f37 100644
--- a/sqldb/v2/sqlite.go
+++ b/sqldb/v2/sqlite.go
@@ -137,7 +137,7 @@ func NewSqliteStore(cfg *SqliteConfig, dbPath string) (*SqliteStore, error) {
}
db.SetMaxOpenConns(defaultMaxConns)
- db.SetMaxIdleConns(defaultMaxConns)
+ db.SetMaxIdleConns(defaultMaxIdleConns)
db.SetConnMaxLifetime(defaultConnMaxLifetime)
s := &SqliteStore{
Why this scored 19/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.