Skip to content

Commit 81dd57e

Browse files
committed
txorphanage: Pass uint256 by reference instead of value
1 parent 9d5313d commit 81dd57e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/txorphanage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ std::map<uint256, std::map<uint256, COrphanTx>::iterator> g_orphans_by_wtxid GUA
2222

2323
std::vector<std::map<uint256, COrphanTx>::iterator> g_orphan_list GUARDED_BY(g_cs_orphans);
2424

25-
int EraseOrphanTx(uint256 hash)
25+
int EraseOrphanTx(const uint256& txid)
2626
{
27-
std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(hash);
27+
std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(txid);
2828
if (it == mapOrphanTransactions.end())
2929
return 0;
3030
for (const CTxIn& txin : it->second.tx->vin)

src/txorphanage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct COrphanTx {
2323
size_t list_pos;
2424
};
2525

26-
int EraseOrphanTx(uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans);
26+
int EraseOrphanTx(const uint256& txid) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans);
2727
void EraseOrphansFor(NodeId peer);
2828
unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans);
2929

0 commit comments

Comments
 (0)