Skip to content

Commit

Permalink
Merge pull request #110 from SiaFoundation/close-statement
Browse files Browse the repository at this point in the history
Close prepared statements
  • Loading branch information
n8maninger authored May 1, 2024
2 parents beb3587 + b7f9ac1 commit 2aaf4b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion persist/sqlite/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func (ut *updateTx) AddEvents(events []wallet.Event) error {
if err != nil {
return fmt.Errorf("failed to prepare relevant address statement: %w", err)
}
defer addrStmt.Close()
defer relevantAddrStmt.Close()

var buf bytes.Buffer
enc := json.NewEncoder(&buf)
Expand Down Expand Up @@ -728,6 +728,7 @@ func (ut *updateTx) RevertOrphans(index types.ChainIndex) (reverted []types.Bloc
if err != nil {
return nil, fmt.Errorf("failed to prepare update statement: %w", err)
}
defer updateBalanceStmt.Close()

for addrID, balance := range revertedBalance {
var existing wallet.Balance
Expand Down

0 comments on commit 2aaf4b2

Please sign in to comment.