aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-05-10 10:55:39 +0100
committerglozow <gloriajzhao@gmail.com>2024-05-14 10:32:27 +0100
commitefcc5930175f31b685adb4627a038d9f0848eb1f (patch)
tree2437c1e04f26b3475591148c14b0635c2e7b1159 /src/net_processing.cpp
parent7e475b9648bbee04f5825b922ba0399373eaa5a9 (diff)
downloadbitcoin-efcc5930175f31b685adb4627a038d9f0848eb1f.tar.xz
[refactor] TxOrphanage::HaveTx only by wtxid
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 985b41b160..0b8b896987 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2297,7 +2297,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid, bool include_reconside
if (gtxid.IsWtxid()) {
// Normal query by wtxid.
- if (m_orphanage.HaveTx(gtxid)) return true;
+ if (m_orphanage.HaveTx(Wtxid::FromUint256(hash))) return true;
} else {
// Never query by txid: it is possible that the transaction in the orphanage has the same
// txid but a different witness, which would give us a false positive result. If we decided
@@ -2307,7 +2307,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid, bool include_reconside
// While we won't query by txid, we can try to "guess" what the wtxid is based on the txid.
// A non-segwit transaction's txid == wtxid. Query this txid "casted" to a wtxid. This will
// help us find non-segwit transactions, saving bandwidth, and should have no false positives.
- if (m_orphanage.HaveTx(GenTxid::Wtxid(hash))) return true;
+ if (m_orphanage.HaveTx(Wtxid::FromUint256(hash))) return true;
}
if (include_reconsiderable && m_recent_rejects_reconsiderable.contains(hash)) return true;