From c3e5757c25f38776e21a5515e187b80b002e8eb9 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Fri, 2 Dec 2016 14:32:28 +0400 Subject: [PATCH] fix relay bug (#1178) --- src/main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bcaf22472..c26dd2d98 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5056,16 +5056,19 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam { // Send stream from relay memory bool pushed = false; - map::iterator mi; { - LOCK(cs_mapRelay); - mi = mapRelay.find(inv); - if (mi != mapRelay.end()) { - pushed = true; + CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); + { + LOCK(cs_mapRelay); + map::iterator mi = mapRelay.find(inv); + if (mi != mapRelay.end()) { + ss += (*mi).second; + pushed = true; + } } + if(pushed) + pfrom->PushMessage(inv.GetCommand(), ss); } - if(pushed) - pfrom->PushMessage(inv.GetCommand(), (*mi).second); if (!pushed && inv.type == MSG_TX) { CTransaction tx;