core/state/snapshot: add a todo for the potential hang

This commit is contained in:
Gary Rong 2024-09-06 18:28:35 +08:00
parent 140ee32dbf
commit 01b294880b

View file

@ -258,6 +258,8 @@ func (t *Tree) Disable() {
for _, layer := range t.layers { for _, layer := range t.layers {
switch layer := layer.(type) { switch layer := layer.(type) {
case *diskLayer: case *diskLayer:
// TODO this function will hang if it's called twice. Will
// fix it in the following PRs.
layer.stopGeneration() layer.stopGeneration()
layer.markStale() layer.markStale()
layer.Release() layer.Release()
@ -715,6 +717,8 @@ func (t *Tree) Rebuild(root common.Hash) {
for _, layer := range t.layers { for _, layer := range t.layers {
switch layer := layer.(type) { switch layer := layer.(type) {
case *diskLayer: case *diskLayer:
// TODO this function will hang if it's called twice. Will
// fix it in the following PRs.
layer.stopGeneration() layer.stopGeneration()
layer.markStale() layer.markStale()
layer.Release() layer.Release()