Skip to content

Commit

Permalink
No need for msgMakerInitProto for sporks because we loop by fully con…
Browse files Browse the repository at this point in the history
…nected nodes only now (#1877)
  • Loading branch information
UdjinM6 authored Jan 26, 2018
1 parent b1817dd commit 1ca270e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/masternode-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
BOOST_FOREACH(CNode* pnode, vNodesCopy)
{
CNetMsgMaker msgMaker(pnode->GetSendVersion());
CNetMsgMaker msgMakerInitProto(INIT_PROTO_VERSION);

// Don't try to sync any data from outbound "masternode" connections -
// they are temporary and should be considered unreliable for a sync process.
Expand All @@ -207,7 +206,7 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
if(Params().NetworkIDString() == CBaseChainParams::REGTEST)
{
if(nRequestedMasternodeAttempt <= 2) {
connman.PushMessage(pnode, msgMakerInitProto.Make(NetMsgType::GETSPORKS)); //get current network sporks
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::GETSPORKS)); //get current network sporks
} else if(nRequestedMasternodeAttempt < 4) {
mnodeman.DsegUpdate(pnode, connman);
} else if(nRequestedMasternodeAttempt < 6) {
Expand Down Expand Up @@ -238,7 +237,7 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
// always get sporks first, only request once from each peer
netfulfilledman.AddFulfilledRequest(pnode->addr, "spork-sync");
// get current network sporks
connman.PushMessage(pnode, msgMakerInitProto.Make(NetMsgType::GETSPORKS));
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::GETSPORKS));
LogPrintf("CMasternodeSync::ProcessTick -- nTick %d nRequestedMasternodeAssets %d -- requesting sporks from peer %d\n", nTick, nRequestedMasternodeAssets, pnode->id);
}

Expand Down

0 comments on commit 1ca270e

Please sign in to comment.