Indexes can be turned off an on between restarts and they are initially synced on their own thread.
Both are a potential reason they could “lag behind” and thus they appear incompatible with pruned mode. However, if they only lag by MIN_BLOCKS_TO_KEEP
, we could allow them to catch up on startup. If they lag behind by more, the background thread might just fetch the blocks from the network?
See also #14121 (review)
Motivation to maintain indexes in pruned mode is that they can be serve to other peers (p2p), or over rpc, or even be used by the own wallet.