Skip to content

Commit 848dd28

Browse files
committed
Fix data race
1 parent aadbf6d commit 848dd28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

data/pools/transactionPool.go

+3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ var ErrStaleBlockAssemblyRequest = fmt.Errorf("AssembleBlock: requested block as
170170

171171
// Reset resets the content of the transaction pool
172172
func (pool *TransactionPool) Reset() {
173+
pool.mu.Lock()
174+
defer pool.mu.Unlock()
175+
defer pool.cond.Broadcast()
173176
pool.pendingTxids = make(map[transactions.Txid]transactions.SignedTxn)
174177
pool.pendingTxGroups = nil
175178
pool.rememberedTxids = make(map[transactions.Txid]transactions.SignedTxn)

0 commit comments

Comments
 (0)