The combination of -reindex-chainstate and -prune currently makes the node stuck in an endless loop:
LoadChainstate()will wipe the existing chainstate (so we have no genesis block anymore). It won't clean up unusable block files by callingCleanupBlockRevFiles()as for full-reindex.ThreadImport()has logic of reloading Genesis after reindexing. This is what makes full-reindexwork with-prunebut it's not executed for-reindex-chainstate.- Since we still don't have a genesis block, init will wait for it forever in an endless loop (code).
Fix this by disallowing -reindex-chainstate together with -prune. This is discouraged in the help for -reindex-chainstate anyway ("When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead.") but wasn't enforced.
Fixes #24242