Skip to content

Commit

Permalink
Merge pull request #38 from SiaFoundation/close-statements
Browse files Browse the repository at this point in the history
Close statements
  • Loading branch information
n8maninger authored Jun 3, 2024
2 parents 2c756a7 + c99d18f commit 1b6dfe7
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 1b6dfe7

Please sign in to comment.