go-ethereum/core/state/snapshot
Arran Schlosberg 23800122b3
core/state/snapshot: simplify snapshot rebuild (#30772)
This PR is purely for improved readability; I was doing work involving
the file and think this may help others who are trying to understand
what's going on.

1. `snapshot.Tree.Rebuild()` now returns a function that blocks until
regeneration is complete, allowing `Tree.waitBuild()` to be removed
entirely as all it did was search for the `done` channel behind this new
function.
2. Its usage inside `New()` is also simplified by (a) only waiting if
`!AsyncBuild`; and (b) avoiding the double negative of `if !NoBuild`.

---------

Co-authored-by: Martin HS <martin@swende.se>
2024-11-25 13:43:23 +01:00
..
context.go all: get rid of custom MaxUint64 and MaxUint64 (#30636) 2024-10-20 14:41:51 +03:00
conversion.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
difflayer.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
difflayer_test.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
disklayer.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
disklayer_test.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
generate.go core, trie, triedb: minor changes from snapshot integration (#30599) 2024-10-18 17:06:31 +02:00
generate_test.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
holdable_iterator.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
holdable_iterator_test.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
iterator.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
iterator_binary.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
iterator_fast.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
iterator_test.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
journal.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
metrics.go all: fix spelling mistakes (#25961) 2022-10-11 09:37:00 +02:00
snapshot.go core/state/snapshot: simplify snapshot rebuild (#30772) 2024-11-25 13:43:23 +01:00
snapshot_test.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00
utils.go core, triedb: remove destruct flag in state snapshot (#30752) 2024-11-22 16:55:43 +08:00