From 32eb6dc758a90b6c154d1e3e503f0d4840c44b02 Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 15 Jan 2025 18:43:10 -0500 Subject: [PATCH] [refactor] assign local variable for wtxid --- src/node/txdownloadman_impl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node/txdownloadman_impl.cpp b/src/node/txdownloadman_impl.cpp index 171ad56fabb..d3f1b7b4030 100644 --- a/src/node/txdownloadman_impl.cpp +++ b/src/node/txdownloadman_impl.cpp @@ -179,7 +179,8 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, // - exists in orphanage // - peer can be an orphan resolution candidate if (gtxid.IsWtxid()) { - if (auto orphan_tx{m_orphanage.GetTx(Wtxid::FromUint256(gtxid.GetHash()))}) { + const auto wtxid{Wtxid::FromUint256(gtxid.GetHash())}; + if (auto orphan_tx{m_orphanage.GetTx(wtxid)}) { auto unique_parents{GetUniqueParents(*orphan_tx)}; std::erase_if(unique_parents, [&](const auto& txid){ return AlreadyHaveTx(GenTxid::Txid(txid), /*include_reconsiderable=*/false); @@ -187,7 +188,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, if (unique_parents.empty()) return true; - if (MaybeAddOrphanResolutionCandidate(unique_parents, orphan_tx->GetWitnessHash(), peer, now)) { + if (MaybeAddOrphanResolutionCandidate(unique_parents, wtxid, peer, now)) { m_orphanage.AddAnnouncer(orphan_tx->GetWitnessHash(), peer); }