From 60c4ab8292ae3770619a79a966f7eb97bd96dd37 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 13 Aug 2015 13:01:10 -0700 Subject: [PATCH 1/5] change proposal requirements --- src/masternode-budget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From d8b18c31f79c499b9fe6391769d7d909c82a20e7 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 13 Aug 2015 14:02:37 -0700 Subject: [PATCH 2/5] Remove blockEnd budget check --- src/masternode-budget.cpp | 1 - 1 file changed, 1 deletion(-) 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; } From 4727d92d1f656eb002a40f3fe045cc10c18f2d33 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 13 Aug 2015 16:35:38 -0700 Subject: [PATCH 3/5] protocol bump --- src/instantx.h | 2 +- src/version.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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/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 From f0790ed32ca22d878b166b3abf0d84b8ece1cbca Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Fri, 14 Aug 2015 04:14:08 +0300 Subject: [PATCH 4/5] fix dseep flood / log output --- src/activemasternode.cpp | 1 + src/masternode.cpp | 3 +++ src/masternode.h | 1 + src/masternodeman.cpp | 13 +++++++++++-- 4 files changed, 16 insertions(+), 2 deletions(-) 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/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); } From dc70f732215ac9f041274efff51e70d7b5e50d94 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 13 Aug 2015 20:56:58 -0700 Subject: [PATCH 5/5] add budget timeout --- src/masternode-sync.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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");