From 81dd57e5b1ab1afa7e59468e30ef41bd34f0c8d7 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Mon, 15 Feb 2021 23:04:21 +1000 Subject: txorphanage: Pass uint256 by reference instead of value --- src/txorphanage.cpp | 4 ++-- src/txorphanage.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/txorphanage.cpp b/src/txorphanage.cpp index fb03914681..d418ed9323 100644 --- a/src/txorphanage.cpp +++ b/src/txorphanage.cpp @@ -22,9 +22,9 @@ std::map::iterator> g_orphans_by_wtxid GUA std::vector::iterator> g_orphan_list GUARDED_BY(g_cs_orphans); -int EraseOrphanTx(uint256 hash) +int EraseOrphanTx(const uint256& txid) { - std::map::iterator it = mapOrphanTransactions.find(hash); + std::map::iterator it = mapOrphanTransactions.find(txid); if (it == mapOrphanTransactions.end()) return 0; for (const CTxIn& txin : it->second.tx->vin) diff --git a/src/txorphanage.h b/src/txorphanage.h index d97b4b1f43..343f12c9c5 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -23,7 +23,7 @@ struct COrphanTx { 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); unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans); -- cgit v1.2.3