#22383 (review) seems preferable, otherwise move comment to the right place (or omit it)
@@ -1167,8 +1167,10 @@ CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMe
CTransactionRef tx;
uint256 block_hash;
if (g_txindex->FindTx(hash, block_hash, tx)) {
- // Transaction was found in a different block than requested.
- if (block_index && block_index->GetBlockHash() != block_hash) return nullptr;
+ if (block_index && block_index->GetBlockHash() != block_hash) {
+ // Transaction was found in a different block than requested.
+ return nullptr;
+ }
hashBlock = block_hash;
return tx;