The extrapool is only used to help reconstruct compact blocks with transactions that for some reason do not fit in our mempool, including consensus invalid transactions.
This small PR excludes the ones initially reported as TX_CONSENSUS from being added to the extrapool, without performing additional validation, as they are not useful to reconstruct consensus valid blocks.
Note that this path does not exclude all consensus invalid transactions. Consensus invalid transactions rejected under other categories remain unaffected and are still added to the extrapool. For example an invalid signature can be reported as TX_NOT_STANDARD during mempool script checks, or remain undetected if validation stops earlier for some other reason such as insufficient fees.
Note that transactions with unknown inputs (orphans) are not treated as consensus invalid as validity cannot be fully determined.
Avoiding all consensus invalid transactions to be included into the extrapool might not be worth the complexity and validation cost, potentially some extra-script verification steps would be needed.
A possible future improvement could be to manage policy-rejected transactions and transactions removed through replacement separately. But this is outside the scope of this PR, which intends to be a small and simple patch.