fixes for mapSeenMasternodeBroadcast:
- active masternode ping should update mapSeenMasternodeBroadcast's lastPing too - dseg should fill mapSeenMasternodeBroadcast to be able to serve it later on getdata with MSG_MASTERNODE_ANNOUNCE inv
This commit is contained in:
parent
518499a819
commit
611640d4e1
@ -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();
|
||||
|
||||
/*
|
||||
|
@ -779,9 +779,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;
|
||||
|
Loading…
Reference in New Issue
Block a user