Skip to content

Commit

Permalink
make sure we dealocate slice
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilagadze committed Jan 5, 2024
1 parent 7e2a504 commit 722900d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions blocktx/peer_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,11 @@ 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 = nil

Check failure on line 498 in blocktx/peer_handler.go

View workflow job for this annotation

GitHub Actions / Golangci-lint

ineffectual assignment to txs (ineffassign)
merklePaths = nil

Check failure on line 499 in blocktx/peer_handler.go

View workflow job for this annotation

GitHub Actions / Golangci-lint

ineffectual assignment to merklePaths (ineffassign)

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 722900d

Please sign in to comment.