mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
txorphanage: Extract GetOrphanTx
Extract orphan lookup code into GetOrphanTx function.
This commit is contained in:
@@ -129,3 +129,11 @@ bool HaveOrphanTx(const GenTxid& gtxid)
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<CTransactionRef, NodeId> GetOrphanTx(const uint256& txid)
|
||||
{
|
||||
AssertLockHeld(g_cs_orphans);
|
||||
|
||||
const auto it = mapOrphanTransactions.find(txid);
|
||||
if (it == mapOrphanTransactions.end()) return {nullptr, -1};
|
||||
return {it->second.tx, it->second.fromPeer};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user