Skip to content

Commit

Permalink
fix: copy the output of Slot() to avoir concurrency issue (#35)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Holst Swende <[email protected]>
  • Loading branch information
gballet and holiman authored May 31, 2022
1 parent 9e0e01e commit 5bb6607
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/geth/converkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ type slotHash struct {
func iterateSlots(slotCh chan *slotHash, storageIt snapshot.StorageIterator) {
defer storageIt.Release()
for storageIt.Next() {
var slot [32]byte
copy(slot[:], storageIt.Slot())
slotCh <- &slotHash{
hash: storageIt.Hash(),
slot: storageIt.Slot(),
slot: slot[:],
}
}
if storageIt.Error() != nil {
Expand Down

0 comments on commit 5bb6607

Please sign in to comment.