Skip to content

Commit

Permalink
fix relay bug (bitcoin#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored Dec 2, 2016
1 parent d9fb724 commit c3e5757
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5056,16 +5056,19 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
{
// Send stream from relay memory
bool pushed = false;
map<CInv, CDataStream>::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<CInv, CDataStream>::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;
Expand Down

0 comments on commit c3e5757

Please sign in to comment.