local nLastDsq (#1211)
* Revert behaviour introduced in 5e1a6afe7f
, make nLastDsq local variable instead of being network-wide one. Should fix mixing for new clients and for those who was offline for too long.
* fix docs
This commit is contained in:
parent
ff12698ed5
commit
fa301ecb49
@ -67,7 +67,7 @@ Whenever a masternode comes online or a client is syncing, they will send this m
|
||||
| 8 | sigTime | int64_t | Time which the signature was created
|
||||
| 4 | nProtocolVersion | int | The protocol version of the masternode
|
||||
| # | lastPing | CMasternodePing | The last known ping of the masternode
|
||||
| 8 | nLastDsq | int64_t | The last time the masternode sent a DSQ message (for mixing)
|
||||
| 8 | nLastDsq | int64_t | The last time the masternode sent a DSQ message (for mixing) (DEPRECATED)
|
||||
|
||||
### MNPING - "mnp"
|
||||
|
||||
|
@ -5145,6 +5145,10 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
|
||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ss.reserve(1000);
|
||||
ss << mnodeman.mapSeenMasternodeBroadcast[inv.hash];
|
||||
// backward compatibility patch
|
||||
if(pfrom->nVersion < 70204) {
|
||||
ss << (int64_t)0;
|
||||
}
|
||||
pfrom->PushMessage(NetMsgType::MNANNOUNCE, ss);
|
||||
pushed = true;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ CMasternode::CMasternode(const CMasternodeBroadcast& mnb) :
|
||||
lastPing(mnb.lastPing),
|
||||
vchSig(mnb.vchSig),
|
||||
sigTime(mnb.sigTime),
|
||||
nLastDsq(mnb.nLastDsq),
|
||||
nLastDsq(0),
|
||||
nTimeLastChecked(0),
|
||||
nTimeLastPaid(0),
|
||||
nTimeLastWatchdogVote(mnb.sigTime),
|
||||
|
@ -342,7 +342,6 @@ public:
|
||||
READWRITE(sigTime);
|
||||
READWRITE(nProtocolVersion);
|
||||
READWRITE(lastPing);
|
||||
READWRITE(nLastDsq);
|
||||
}
|
||||
|
||||
uint256 GetHash() const
|
||||
|
@ -19,7 +19,7 @@
|
||||
/** Masternode manager */
|
||||
CMasternodeMan mnodeman;
|
||||
|
||||
const std::string CMasternodeMan::SERIALIZATION_VERSION_STRING = "CMasternodeMan-Version-1";
|
||||
const std::string CMasternodeMan::SERIALIZATION_VERSION_STRING = "CMasternodeMan-Version-2";
|
||||
|
||||
struct CompareLastPaidBlock
|
||||
{
|
||||
@ -700,6 +700,12 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
|
||||
CMasternodeBroadcast mnb;
|
||||
vRecv >> mnb;
|
||||
|
||||
// backward compatibility patch
|
||||
if(pfrom->nVersion < 70204) {
|
||||
int64_t nLastDsqDummy;
|
||||
vRecv >> nLastDsqDummy;
|
||||
}
|
||||
|
||||
int nDos = 0;
|
||||
|
||||
if (CheckMnbAndUpdateMasternodeList(mnb, nDos)) {
|
||||
|
Loading…
Reference in New Issue
Block a user