Skip to content

Commit

Permalink
close two prepared statements that aren't being closed
Browse files Browse the repository at this point in the history
  • Loading branch information
chris124567 committed Jun 3, 2024
1 parent fc8b737 commit c99d18f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions persist/sqlite/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ func addTransactions(tx *txn, bid types.BlockID, txns []types.Transaction, scDBI
if err != nil {
return nil, fmt.Errorf("failed to prepare check transaction statement: %v", err)
}
defer checkTransactionStmt.Close()

insertTransactionStmt, err := tx.Prepare(`INSERT INTO transactions (transaction_id) VALUES (?)`)
if err != nil {
Expand Down Expand Up @@ -747,6 +748,7 @@ func addFileContractElements(tx *txn, b types.Block, fces []explorer.FileContrac
if err != nil {
return nil, fmt.Errorf("addFileContractElements: failed to prepare last_contract_revision statement: %w", err)
}
defer revisionStmt.Close()

fcDBIds := make(map[explorer.DBFileContract]int64)
addFC := func(fcID types.FileContractID, leafIndex uint64, fc types.FileContract, resolved, valid, lastRevision bool) error {
Expand Down

0 comments on commit c99d18f

Please sign in to comment.