mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 21:12:29 +02:00
Add a wtxid-index to mapRelay
This commit is contained in:
parent
60f0acda71
commit
08b39955ec
@ -4246,6 +4246,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));
|
||||
|
Loading…
Reference in New Issue
Block a user