Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/txDupCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ func (c *txSaltedCache) CheckAndPut(msg []byte) (*crypto.Digest, bool) {
// already added to cache between RUnlock() and Lock(), return
return d, found
}
} else {
// Do another check to see if another copy of the transaction won the race to write it to the cache
// Only check current to save a lookup since swaps are rare and no need to re-hash
if _, found := c.cur[*d]; found {
return d, found
}
}

Comment thread
cce marked this conversation as resolved.
if len(c.cur) >= c.maxSize {
Expand Down