mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 23:42:33 +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) {
|
if (ret.second) {
|
||||||
vRelayExpiration.push_back(std::make_pair(nNow + std::chrono::microseconds{RELAY_TX_CACHE_TIME}.count(), ret.first));
|
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) {
|
if (vInv.size() == MAX_INV_SZ) {
|
||||||
connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));
|
connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));
|
||||||
|
Loading…
Reference in New Issue
Block a user