directly send inv messages

This commit is contained in:
Evan Duffield 2015-07-25 19:27:40 -07:00
parent c0a5dfba61
commit 61becf2f11
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@
// Bootup the Masternode, look for a 1000DRK input and register on the network // Bootup the Masternode, look for a 1000DRK input and register on the network
// //
void CActiveMasternode::ManageStatus() void CActiveMasternode::ManageStatus()
{ {
std::string errorMessage; std::string errorMessage;
if(!fMasterNode) return; if(!fMasterNode) return;

View File

@ -711,6 +711,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
} }
} //else, asking for a specific node which is ok } //else, asking for a specific node which is ok
std::vector<CInv> vInv;
int i = 0; int i = 0;
BOOST_FOREACH(CMasternode& mn, vMasternodes) { BOOST_FOREACH(CMasternode& mn, vMasternodes) {
if(mn.addr.IsRFC1918()) continue; //local network if(mn.addr.IsRFC1918()) continue; //local network
@ -719,10 +720,10 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
if(fDebug) LogPrintf("dseg - Sending Masternode entry - %s \n", mn.addr.ToString().c_str()); if(fDebug) LogPrintf("dseg - Sending Masternode entry - %s \n", mn.addr.ToString().c_str());
if(vin == CTxIn()){ if(vin == CTxIn()){
CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash()); CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash());
pfrom->PushInventory(inv); vInv.push_back(inv);
} else if (vin == mn.vin) { } else if (vin == mn.vin) {
CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash()); CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash());
pfrom->PushInventory(inv); vInv.push_back(inv);
LogPrintf("dseg - Sent 1 Masternode entries to %s\n", pfrom->addr.ToString().c_str()); LogPrintf("dseg - Sent 1 Masternode entries to %s\n", pfrom->addr.ToString().c_str());
return; return;
@ -730,6 +731,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
i++; i++;
} }
} }
if(vInv.size() > 0) pfrom->PushMessage("inv", vInv);
LogPrintf("dseg - Sent %d Masternode entries to %s\n", i, pfrom->addr.ToString().c_str()); LogPrintf("dseg - Sent %d Masternode entries to %s\n", i, pfrom->addr.ToString().c_str());
} }