Commit e57f951
committed
init, validation: Fix -reindex option with an existing snapshot
This didn't work for two reasons:
1.) GetSnapshotCoinsDBPath() was used to retrieve the path.
This requires coins_views to exist, but the initialisation only happens later
(in CompleteChainstateInitialization) so the node hits an assert in
CCoinsViewDB& CoinsDB() and crashes.
2.) The snapshot was already activated, so it has the mempool attached.
Therefore, the mempool needs to be transferred back to the ibd
chainstate before deleting the snapshot chainstate.1 parent 2e1c84b commit e57f951
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6140 | 6140 | | |
6141 | 6141 | | |
6142 | 6142 | | |
6143 | | - | |
| 6143 | + | |
6144 | 6144 | | |
6145 | 6145 | | |
6146 | 6146 | | |
6147 | 6147 | | |
6148 | 6148 | | |
6149 | 6149 | | |
| 6150 | + | |
6150 | 6151 | | |
6151 | 6152 | | |
6152 | 6153 | | |
| |||
0 commit comments