Problem: The mempool estimator added in #34075 checks health by comparing the weight of mempool transactions removed for a block with the block’s non-coinbase transaction weight.
It gets the removed entries from removeForBlock and sums their local weight.
That function matches mempool entries to block transactions by txid, which does not commit to witness data.
A matched entry can therefore have a different weight from the mined transaction, skewing the coverage check.
The block policy estimator also treats the local variant as confirmed even though its wtxid was not in the block.
Same-txid, different-witness transactions also appear in #35501 and #35893.
Fix: First, calculate total and covered block weight in one pass, computing each block transaction’s weight once and reusing it when a mempool entry matches.
This follows the one-pass accounting in GetMempoolHealth and makes the mined-weight basis explicit.
Then require an exact wtxid match in removeForBlock before reporting a mempool entry as mined.
A mismatched local variant is removed as a conflict, so neither estimator treats it as mined.