mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-07 05:31:03 +02:00
txorphanage: Pass uint256 by reference instead of value
This commit is contained in:
parent
9d5313df7e
commit
81dd57e5b1
@ -22,9 +22,9 @@ std::map<uint256, std::map<uint256, COrphanTx>::iterator> g_orphans_by_wtxid GUA
|
|||||||
|
|
||||||
std::vector<std::map<uint256, COrphanTx>::iterator> g_orphan_list GUARDED_BY(g_cs_orphans);
|
std::vector<std::map<uint256, COrphanTx>::iterator> g_orphan_list GUARDED_BY(g_cs_orphans);
|
||||||
|
|
||||||
int EraseOrphanTx(uint256 hash)
|
int EraseOrphanTx(const uint256& txid)
|
||||||
{
|
{
|
||||||
std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(hash);
|
std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(txid);
|
||||||
if (it == mapOrphanTransactions.end())
|
if (it == mapOrphanTransactions.end())
|
||||||
return 0;
|
return 0;
|
||||||
for (const CTxIn& txin : it->second.tx->vin)
|
for (const CTxIn& txin : it->second.tx->vin)
|
||||||
|
@ -23,7 +23,7 @@ struct COrphanTx {
|
|||||||
size_t list_pos;
|
size_t list_pos;
|
||||||
};
|
};
|
||||||
|
|
||||||
int EraseOrphanTx(uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans);
|
int EraseOrphanTx(const uint256& txid) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans);
|
||||||
void EraseOrphansFor(NodeId peer);
|
void EraseOrphansFor(NodeId peer);
|
||||||
unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans);
|
unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user