Skip to content

Commit 61d480d

Browse files
committed
Linearize snapshots
1 parent fb66ad1 commit 61d480d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

trie/ctrie/ctrie.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ func (c *Ctrie) Snapshot() *Ctrie {
322322
root := c.readRoot()
323323
main := gcasRead(root, c)
324324
if c.rdcssRoot(root, main, root.copyToGen(&generation{}, c)) {
325-
return newCtrie(root.copyToGen(&generation{}, c), c.hashFactory, c.readOnly)
325+
return newCtrie(c.readRoot().copyToGen(&generation{}, c), c.hashFactory, c.readOnly)
326326
}
327327
}
328328
}
@@ -337,7 +337,7 @@ func (c *Ctrie) ReadOnlySnapshot() *Ctrie {
337337
root := c.readRoot()
338338
main := gcasRead(root, c)
339339
if c.rdcssRoot(root, main, root.copyToGen(&generation{}, c)) {
340-
return newCtrie(root, c.hashFactory, true)
340+
return newCtrie(c.readRoot(), c.hashFactory, true)
341341
}
342342
}
343343
}

0 commit comments

Comments
 (0)