txpool: add a fast path in TxPool::EraseForBlock when the pool is empty
Summary:
This is inspired by core#32827 and D13214:
orphanage: avoid vtx iteration when no orphans
We can avoid a costly iteration over all transaction inputs in a block if we already know that we don't have any txs to erase in our pool.
The subsequent call to TxPool::EraseTxNoLock would also be a no-op with an early return (if (m_pool_txs.find(txid) == m_pool_txs.end()) return 0;)
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18986