Merge pull request #575 from UdjinM6/v0.12.0.x_fix_mapSeenMasternodeBroadcast

V0.12.1.x fixes for mapSeenMasternodeBroadcast:
This commit is contained in:
evan82 2015-08-28 19:52:14 -07:00
commit 3729d93097
2 changed files with 11 additions and 1 deletions

View File

@ -180,6 +180,12 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage) {
pmn->lastPing = mnp;
mnodeman.mapSeenMasternodePing.insert(make_pair(mnp.GetHash(), mnp));
//mnodeman.mapSeenMasternodeBroadcast.lastPing is probably outdated, so we'll update it
CMasternodeBroadcast mnb(*pmn);
uint256 hash = mnb.GetHash();
if(mnodeman.mapSeenMasternodeBroadcast.count(hash)) mnodeman.mapSeenMasternodeBroadcast[hash].lastPing = mnp;
mnp.Relay();
/*

View File

@ -768,9 +768,13 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
if(mn.IsEnabled()) {
LogPrint("masnernode", "dseg - Sending Masternode entry - %s \n", mn.addr.ToString());
if(vin == CTxIn() || vin == mn.vin){
CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash());
CMasternodeBroadcast mnb = CMasternodeBroadcast(mn);
uint256 hash = mnb.GetHash();
CInv inv(MSG_MASTERNODE_ANNOUNCE, hash);
vInv.push_back(inv);
if(!mapSeenMasternodeBroadcast.count(hash)) mapSeenMasternodeBroadcast.insert(make_pair(hash, mnb));
if(vin == mn.vin) {
LogPrintf("dseg - Sent 1 Masternode entries to %s\n", pfrom->addr.ToString());
break;