Skip to content

Commit

Permalink
Merge pull request #234 from bitcoin-sv/recreate-slice
Browse files Browse the repository at this point in the history
make sure we dealocate slice
  • Loading branch information
shotasilagadzetaal authored Jan 5, 2024
2 parents d5f2980 + cbc20b1 commit 3385345
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blocktx/peer_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ func (bs *PeerHandler) markTransactionsAsMined(blockId uint64, merkleTree []*cha
return fmt.Errorf("failed to insert block transactions at block height %d: %v", blockHeight, err)
}
// free up memory
txs = txs[:0]
merklePaths = merklePaths[:0]
txs = make([]*blocktx_api.TransactionAndSource, 0, bs.transactionStorageBatchSize)
merklePaths = make([]string, 0, bs.transactionStorageBatchSize)

// print stats, call gc and chec the result
bs.printMemStats()
Expand Down

0 comments on commit 3385345

Please sign in to comment.