Update lastPing in mapSeen obj, remove ping from CMasternode hash

This commit is contained in:
Evan Duffield 2015-07-25 21:13:17 -07:00
parent 04fc6e1fb4
commit b04faf6e2d
5 changed files with 18 additions and 13 deletions

View File

@ -31,7 +31,7 @@ class CConsensusVote;
class CTransaction; class CTransaction;
class CTransactionLock; class CTransactionLock;
static const int MIN_INSTANTX_PROTO_VERSION = 70097; static const int MIN_INSTANTX_PROTO_VERSION = 70098;
extern map<uint256, CTransaction> mapTxLockReq; extern map<uint256, CTransaction> mapTxLockReq;
extern map<uint256, CTransaction> mapTxLockReqRejected; extern map<uint256, CTransaction> mapTxLockReqRejected;

View File

@ -603,6 +603,13 @@ bool CMasternodePing::CheckAndUpdate(int& nDos, bool fRequireEnabled)
pmn->lastPing = *this; pmn->lastPing = *this;
//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 = *this;
}
pmn->Check(); pmn->Check();
if(!pmn->IsEnabled()) return false; if(!pmn->IsEnabled()) return false;

View File

@ -309,7 +309,6 @@ public:
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << sigTime; ss << sigTime;
ss << pubkey; ss << pubkey;
ss << lastPing;
return ss.GetHash(); return ss.GetHash();
} }

View File

@ -718,15 +718,14 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
if(mn.IsEnabled()) { if(mn.IsEnabled()) {
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() || vin == mn.vin){
CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash());
vInv.push_back(inv);
} else if (vin == mn.vin) {
CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash()); CInv inv(MSG_MASTERNODE_ANNOUNCE, CMasternodeBroadcast(mn).GetHash());
vInv.push_back(inv); vInv.push_back(inv);
if(vin == mn.vin) {
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; break;
}
} }
i++; i++;
} }

View File

@ -10,7 +10,7 @@
* network protocol versioning * network protocol versioning
*/ */
static const int PROTOCOL_VERSION = 70097; static const int PROTOCOL_VERSION = 70098;
//! initial proto version, to be increased after version/verack negotiation //! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209; static const int INIT_PROTO_VERSION = 209;
@ -22,19 +22,19 @@ static const int GETHEADERS_VERSION = 70077;
static const int MIN_PEER_PROTO_VERSION = 70066; static const int MIN_PEER_PROTO_VERSION = 70066;
//! minimum peer version accepted by DarksendPool //! minimum peer version accepted by DarksendPool
static const int MIN_POOL_PEER_PROTO_VERSION = 70097; static const int MIN_POOL_PEER_PROTO_VERSION = 70098;
//! minimum peer version for masternode budgets //! minimum peer version for masternode budgets
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70097; static const int MIN_BUDGET_PEER_PROTO_VERSION = 70098;
//! minimum peer version for masternode winner broadcasts //! minimum peer version for masternode winner broadcasts
static const int MIN_MNW_PEER_PROTO_VERSION = 70097; static const int MIN_MNW_PEER_PROTO_VERSION = 70098;
//! minimum peer version that can receive masternode payments //! minimum peer version that can receive masternode payments
// V1 - Last protocol version before update // V1 - Last protocol version before update
// V2 - Newest protocol version // V2 - Newest protocol version
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70066; static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70066;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70097; static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70098;
//! nTime field added to CAddress, starting with this version; //! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this //! if possible, avoid requesting addresses nodes older than this