diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index f97b65eb2..ce9e0481b 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -200,6 +200,7 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage) { return false; } + LogPrint("masternode", "dseep - relaying from active mn, %s \n", vin.ToString().c_str()); LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) pnode->PushMessage("dseep", vin, vchMasterNodeSignature, masterNodeSignatureTime, false); diff --git a/src/instantx.h b/src/instantx.h index 4c93d6509..b81f4d745 100644 --- a/src/instantx.h +++ b/src/instantx.h @@ -32,7 +32,7 @@ class CConsensusVote; class CTransaction; class CTransactionLock; -static const int MIN_INSTANTX_PROTO_VERSION = 70102; +static const int MIN_INSTANTX_PROTO_VERSION = 70103; extern map mapTxLockReq; extern map mapTxLockReqRejected; diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index 2e6ce9066..0244f0141 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -1868,7 +1868,6 @@ bool CFinalizedBudget::IsValid(std::string& strError, bool fCheckCollateral) if(pindexPrev == NULL) return true; if(nBlockStart < pindexPrev->nHeight-100) {strError = "Older than current blockHeight"; return false;} - if(GetBlockEnd() < pindexPrev->nHeight - GetBudgetPaymentCycleBlocks()/2) {strError = "BlockEnd is older than blockHeight - cycle/2"; return false;} return true; } diff --git a/src/masternode-budget.h b/src/masternode-budget.h index c2410424e..a09bbc159 100644 --- a/src/masternode-budget.h +++ b/src/masternode-budget.h @@ -32,7 +32,7 @@ class CTxBudgetPayment; #define VOTE_YES 1 #define VOTE_NO 2 -static const CAmount BUDGET_FEE_TX = (0.5*COIN); +static const CAmount BUDGET_FEE_TX = (5*COIN); static const int64_t BUDGET_FEE_CONFIRMATIONS = 6; static const int64_t BUDGET_VOTE_UPDATE_MIN = 60*60; diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 303667505..f8d0f9e86 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -331,6 +331,13 @@ void CMasternodeSync::Process() return; } + // timeout + if(lastBudgetItem == 0 && RequestedMasternodeAttempt >= MASTERNODE_SYNC_THRESHOLD*3) { + GetNextAsset(); + activeMasternode.ManageStatus(); + return; + } + if(pnode->HasFulfilledRequest("busync")) continue; pnode->FulfilledRequest("busync"); diff --git a/src/masternode.cpp b/src/masternode.cpp index ddaa23d00..c1b1bb404 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -73,6 +73,7 @@ CMasternode::CMasternode() nScanningErrorCount = 0; nLastScanningErrorBlockHeight = 0; lastTimeChecked = 0; + nLastDseep = 0;// temporary, do not save. Remove after migration to v12 } CMasternode::CMasternode(const CMasternode& other) @@ -95,6 +96,7 @@ CMasternode::CMasternode(const CMasternode& other) nScanningErrorCount = other.nScanningErrorCount; nLastScanningErrorBlockHeight = other.nLastScanningErrorBlockHeight; lastTimeChecked = 0; + nLastDseep = other.nLastDseep;// temporary, do not save. Remove after migration to v12 } CMasternode::CMasternode(const CMasternodeBroadcast& mnb) @@ -117,6 +119,7 @@ CMasternode::CMasternode(const CMasternodeBroadcast& mnb) nScanningErrorCount = 0; nLastScanningErrorBlockHeight = 0; lastTimeChecked = 0; + nLastDseep = 0;// temporary, do not save. Remove after migration to v12 } // diff --git a/src/masternode.h b/src/masternode.h index 29848b737..2751b86bc 100644 --- a/src/masternode.h +++ b/src/masternode.h @@ -135,6 +135,7 @@ public: int nLastScanningErrorBlockHeight; CMasternodePing lastPing; + int64_t nLastDseep;// temporary, do not save. Remove after migration to v12 CMasternode(); CMasternode(const CMasternode& other); diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 501d20d9c..3be5cf1cc 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -1006,13 +1006,20 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } + std::map::iterator i = mWeAskedForMasternodeListEntry.find(vin.prevout); + if (i != mWeAskedForMasternodeListEntry.end()) + { + int64_t t = (*i).second; + if (GetTime() < t) return; // we've asked recently + } + // see if we have this Masternode CMasternode* pmn = this->Find(vin); if(pmn != NULL && pmn->protocolVersion >= masternodePayments.GetMinMasternodePaymentsProto()) { // LogPrintf("dseep - Found corresponding mn for vin: %s\n", vin.ToString().c_str()); // take this only if it's newer - if(sigTime - pmn->lastPing.sigTime > MASTERNODE_MIN_MNP_SECONDS) + if(sigTime - pmn->nLastDseep > MASTERNODE_MIN_MNP_SECONDS) { std::string strMessage = pmn->addr.ToString() + boost::lexical_cast(sigTime) + boost::lexical_cast(stop); @@ -1026,10 +1033,12 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData // fake ping for v11 masternodes, ignore for v12 if(pmn->protocolVersion < GETHEADERS_VERSION) pmn->lastPing = CMasternodePing(vin); + pmn->nLastDseep = sigTime; pmn->Check(); if(pmn->IsEnabled()) { TRY_LOCK(cs_vNodes, lockNodes); if(!lockNodes) return; + LogPrint("masternode", "dseep - relaying %s \n", vin.ToString().c_str()); BOOST_FOREACH(CNode* pnode, vNodes) if(pnode->nVersion >= masternodePayments.GetMinMasternodePaymentsProto()) pnode->PushMessage("dseep", vin, vchSig, sigTime, stop); @@ -1038,7 +1047,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } - LogPrint("masternode", "dseep - Couldn't find Masternode entry %s\n", vin.ToString().c_str()); + LogPrint("masternode", "dseep - Couldn't find Masternode entry %s %s\n", vin.ToString(), pfrom->addr.ToString()); AskForMN(pfrom, vin); } diff --git a/src/version.h b/src/version.h index 603e682f3..12f3cceea 100644 --- a/src/version.h +++ b/src/version.h @@ -10,7 +10,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 70102; +static const int PROTOCOL_VERSION = 70103; //! initial proto version, to be increased after version/verack negotiation 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; //! minimum peer version accepted by DarksendPool -static const int MIN_POOL_PEER_PROTO_VERSION = 70102; +static const int MIN_POOL_PEER_PROTO_VERSION = 70103; //! minimum peer version for masternode budgets -static const int MIN_BUDGET_PEER_PROTO_VERSION = 70102; +static const int MIN_BUDGET_PEER_PROTO_VERSION = 70103; //! minimum peer version for masternode winner broadcasts -static const int MIN_MNW_PEER_PROTO_VERSION = 70102; +static const int MIN_MNW_PEER_PROTO_VERSION = 70103; //! minimum peer version that can receive masternode payments // V1 - Last protocol version before update // V2 - Newest protocol version static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70066; -static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70102; +static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70103; //! nTime field added to CAddress, starting with this version; //! if possible, avoid requesting addresses nodes older than this