Draft until reindex-chainstate performance is measured.
Problem: Block preparation inserts an unused final transaction ID, repeatedly constructs salted transaction-ID sets, and allocates a worker-task vector. Small input queues also submit more tasks than can do useful work.
Fix: Insert each transaction ID before scanning the following transaction's inputs. Reuse the set's buckets and hash salt and the worker-task vector across blocks. Limit submitted tasks to the smaller of the worker and queued-input counts.