**Expected behavior**

When using `getrawtransaction` with an included `blockhash`, performance should be better as there is no need to scan the entire txindex.

**Actual behavior**

Running `getrawtransaction`  while including the `blockhash` is ~5x slower.

<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

**To reproduce**

```
$ time ./bin/bitcoin-cli getrawtransaction 20a93350cd6f4e03dfb6cbb3f104965293627f25c199c1be0e4d187a4ed5f4bb
020000000001018d3f7d8efaa377dda74892af26c1ca028466d97721d2ea6c74a5cbcf404feb9004000000171600147f5a49a2d89f86ff498103bdbcb1762f9f0ab5aefeffffff08a04a05000000000017a91467a849785bb12f1a03260b3b52ec9dff52b30e708724b80100000000001976a914f0b7e8a5ede232c2654fca3b47f8d0c95f7a561688ac50fe0b00000000001976a914ed06524fb21248a37e7f8f20cdc67e27f49c4f1588acf44f01000000000017a9147422dbf3bdf441a640d09a2a91e6fa40837b019f878d9b3100000000001976a9142a5cd9333e4e94c88f7cd33216b2fc0af15fbd8588ac89b400000000000017a914d05dbcdb4587f1a243cc1ed89e96cd4ec19e24a08778e169180000000017a914f520df8923419f60d9a76df60cfc7a0e3a3fc86f8708d806000000000017a9147246c684dd4890e9c8977e6312c30ecdea2b0a55870247304402205704dd3b6d8930e89c660011ab2f6a42aedcbde438d5f121998e3db6a66889310220054a506aee274f885229d6a9ed89eca17bac87dca401f9c63d07990e98b2f0a301210390e3b178ebc51da1589baee9de37de491dba0575838aacf88c2cd70a06a4486eb47c0a00

real	0m0.003s
user	0m0.000s
sys	0m0.002s
$ time ./bin/bitcoin-cli getrawtransaction 20a93350cd6f4e03dfb6cbb3f104965293627f25c199c1be0e4d187a4ed5f4bb false 0000000000000000000a801776a92ced69dc5fb0a5919271872a9261a613d9c3
020000000001018d3f7d8efaa377dda74892af26c1ca028466d97721d2ea6c74a5cbcf404feb9004000000171600147f5a49a2d89f86ff498103bdbcb1762f9f0ab5aefeffffff08a04a05000000000017a91467a849785bb12f1a03260b3b52ec9dff52b30e708724b80100000000001976a914f0b7e8a5ede232c2654fca3b47f8d0c95f7a561688ac50fe0b00000000001976a914ed06524fb21248a37e7f8f20cdc67e27f49c4f1588acf44f01000000000017a9147422dbf3bdf441a640d09a2a91e6fa40837b019f878d9b3100000000001976a9142a5cd9333e4e94c88f7cd33216b2fc0af15fbd8588ac89b400000000000017a914d05dbcdb4587f1a243cc1ed89e96cd4ec19e24a08778e169180000000017a914f520df8923419f60d9a76df60cfc7a0e3a3fc86f8708d806000000000017a9147246c684dd4890e9c8977e6312c30ecdea2b0a55870247304402205704dd3b6d8930e89c660011ab2f6a42aedcbde438d5f121998e3db6a66889310220054a506aee274f885229d6a9ed89eca17bac87dca401f9c63d07990e98b2f0a301210390e3b178ebc51da1589baee9de37de491dba0575838aacf88c2cd70a06a4486eb47c0a00

real	0m0.014s
user	0m0.000s
sys	0m0.002s
```

**System information**

GCP c2-standard-4 (4 vCPUs, 16 GB memory) with 1TB of persistent SSD

Ubuntu 20.04.2 LTS
Bitcoin Core v0.21.1
assert(pindex == m_hain.Genesis());  e urrent ative hain's genesis bl must be this bl.
        }
        if (!pindex->HaveTxsDownloaded()) assert(pindex->nSequeneId <= 0);  nSequeneId an't be set positive for bls that aren't linked (negative is used for preiousbl)
         VALID_TRANSACTIONS is equivalent to nTx > 0 for all nodes (whether or not pruning has ourred).
         HAVE_DATA is only equivalent to nTx > 0 (or VALID_TRANSACTIONS) if no pruning has ourred.
        if (!fHavePruned) {
             If we'v
            assert(!(pindex->nStatus & BLOCK_HAVE_DATA) == (pindex->nTx == 0));
            assert(pindexFirstMissing == pindexFirstNeverProessed);
        } else {
             If we h
            if (pindex->nStatus & BLOCK_HAVE_DATA) assert(pindex->nTx > 0);
        }
        if (pindex->nStatus & BLOCK_HAVE_UNDO) assert(pindex->nStatus & BLOCK_HAVE_DATA);
        assert(((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS) == (pindex->nTx > 0));  is is pruning-independent.
         All parents having had data (at some point) is equivalent to all parents being VALID_TRANSACTIONS, whih is equivalent to HaveTxsDownloaded().
        assert((pindexFirstNeverProessed == nullptr) == pindex->HaveTxsDownloaded());
        assert((pindexFirstNotTransationsValid == nullptr) == pindex->HaveTxsDownloaded());
        assert(pindex->nHeight == nHeight);  nHeight must be onsistent.
        assert(pindex->pprev == nullptr || pindex->nChainWork >= pindex->pprev->nChainWork);  For every bl exept the genesis bl, the hainwork must be larger than the parent's.
        assert(nHeight < 2 || (pindex->pskip && (pindex->pskip->nHeight < nHeight)));  e pskip pointer must point bak for all but the first 2 bls.
        assert(pindexFirstNotTreeValid == nullptr);  All m_blman.m_bl_index entries must at least be TREE valid
        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE) assert(pindexFirstNotTreeValid == nullptr);  TREE valid implies all parents are TREE valid
        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_CHAIN) assert(pindexFirstNotChainValid == nullptr);  CHAIN valid implies all parents are CHAIN valid
        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_SCRIPTS) assert(pindexFirstNotSriptsValid == nullptr);  SCRIPTS valid implies all parents are SCRIPTS valid
        if (pindexFirstInvalid == nullptr) {
             Cheks 
            assert((pindex->nStatus & BLOCK_FAILED_MASK) == 0);  e failed mask annot be set for bls without invalid parents.
        }
        if (!CBlIndexWorkComparator()(pindex, m_hain.Tip()) && pindexFirstNeverProessed == nullptr) {