aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net_processing.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 3e050bbe4c..b6822d9303 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3932,6 +3932,11 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
if (ret.second) {
vRelayExpiration.push_back(std::make_pair(nNow + std::chrono::microseconds{RELAY_TX_CACHE_TIME}.count(), ret.first));
}
+ // Add wtxid-based lookup into mapRelay as well, so that peers can request by wtxid
+ auto ret2 = mapRelay.emplace(ret.first->second->GetWitnessHash(), ret.first->second);
+ if (ret2.second) {
+ vRelayExpiration.emplace_back(nNow + std::chrono::microseconds{RELAY_TX_CACHE_TIME}.count(), ret2.first);
+ }
}
if (vInv.size() == MAX_INV_SZ) {
connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));