mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-18 13:07:58 +02:00
The defer closure checked a local err variable for commit/rollback decisions, but err remained nil after a successful BeginTx. When txBody failed, the error was returned directly without assigning to err, so the defer always committed instead of rolling back. Additionally, since err was not a named return value, the defer's Commit error assignment was silently swallowed. Replace the error-prone defer pattern with explicit rollback on txBody failure and a direct Commit return. |
||
|---|---|---|
| .. | ||
| models | ||
| sqlc | ||
| addr.go | ||
| codec.go | ||
| errors.go | ||
| interfaces.go | ||
| kv_store.go | ||
| log.go | ||
| sql_migration.go | ||
| sql_migration_test.go | ||
| sql_store.go | ||
| test_kvdb.go | ||
| test_postgres.go | ||
| test_sql.go | ||
| test_sqlite.go | ||