Now, it serves as a fail-fast mechanism.
This sentence strikes me as odd; I think it gives the idea that perhaps this check is redundant (but faster to calculate) with the check that involves all descendants, which isn't the case.
If it were me, I'd add a comment like this to the code:
The replacement transaction must have a higher feerate than its direct conflicts.
- The motivation for this check is to ensure that the replacement transaction is preferable
for block-inclusion, compared to what would be removed from the mempool.
- This logic predates ancestor feerate-based transaction selection, which is why it doesn't
consider feerates of descendants.
- Note: Ancestor feerate-based transaction selection has made this comparison insufficient
to guarantee that this is incentive-compatible for miners, because it is possible for a
descendant transaction of a direct conflict to pay a higher feerate than the transaction
that might replace them, under these rules.