Skip to content

Commit a31f6d5

Browse files
committed
core/state/snapshot: fix panic on missing parent
1 parent 8d6cc16 commit a31f6d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/state/snapshot/snapshot.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ func (t *Tree) Update(blockRoot common.Hash, parentRoot common.Hash, destructs m
283283
return errSnapshotCycle
284284
}
285285
// Generate a new snapshot on top of the parent
286-
parent := t.Snapshot(parentRoot).(snapshot)
286+
parent := t.Snapshot(parentRoot)
287287
if parent == nil {
288288
return fmt.Errorf("parent [%#x] snapshot missing", parentRoot)
289289
}
290-
snap := parent.Update(blockRoot, destructs, accounts, storage)
290+
snap := parent.(snapshot).Update(blockRoot, destructs, accounts, storage)
291291

292292
// Save the new snapshot for later
293293
t.lock.Lock()

0 commit comments

Comments
 (0)