Skip to content

Commit 5bb6607

Browse files
gballetholiman
andauthored
fix: copy the output of Slot() to avoir concurrency issue (#35)
Co-authored-by: Martin Holst Swende <[email protected]>
1 parent 9e0e01e commit 5bb6607

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/geth/converkle.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ type slotHash struct {
142142
func iterateSlots(slotCh chan *slotHash, storageIt snapshot.StorageIterator) {
143143
defer storageIt.Release()
144144
for storageIt.Next() {
145+
var slot [32]byte
146+
copy(slot[:], storageIt.Slot())
145147
slotCh <- &slotHash{
146148
hash: storageIt.Hash(),
147-
slot: storageIt.Slot(),
149+
slot: slot[:],
148150
}
149151
}
150152
if storageIt.Error() != nil {

0 commit comments

Comments
 (0)