mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge 7925f3aba8 into merged_master (Bitcoin PR bitcoin/bitcoin#22383)
This commit is contained in:
commit
7050d04a75
3 changed files with 24 additions and 20 deletions
|
|
@ -1248,6 +1248,20 @@ CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMe
|
|||
{
|
||||
LOCK(cs_main);
|
||||
|
||||
if (mempool && !block_index) {
|
||||
CTransactionRef ptx = mempool->get(hash);
|
||||
if (ptx) return ptx;
|
||||
}
|
||||
if (g_txindex) {
|
||||
CTransactionRef tx;
|
||||
uint256 block_hash;
|
||||
if (g_txindex->FindTx(hash, block_hash, tx)) {
|
||||
if (!block_index || block_index->GetBlockHash() == block_hash) {
|
||||
hashBlock = block_hash;
|
||||
return tx;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (block_index) {
|
||||
CBlock block;
|
||||
if (ReadBlockFromDisk(block, block_index, consensusParams)) {
|
||||
|
|
@ -1258,15 +1272,6 @@ CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMe
|
|||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
if (mempool) {
|
||||
CTransactionRef ptx = mempool->get(hash);
|
||||
if (ptx) return ptx;
|
||||
}
|
||||
if (g_txindex) {
|
||||
CTransactionRef tx;
|
||||
if (g_txindex->FindTx(hash, hashBlock, tx)) return tx;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue