diff --git a/ZNODE.md b/ZNODE.md index c9153395cb..5ac650417c 100644 --- a/ZNODE.md +++ b/ZNODE.md @@ -7,7 +7,7 @@ Prerequisites ------------- - Ubuntu 16.04+ - Libraries to build from zcoin source - - Port 18618 is open + - Port **18618** is open Step 1. Build ---------------------- @@ -17,11 +17,11 @@ Step 1. Build **1.2.** See [README.md](README.md) for instructions on building. -Step 2. (Optional - only if firewall is running). Open port 18618 +Step 2. (Optional - only if firewall is running). Open port 28618 ---------------------- **2.1.** Run: - sudo ufw allow 18618 + sudo ufw allow 28618 sudo ufw default allow outgoing sudo ufw enable diff --git a/src/activeznode.cpp b/src/activeznode.cpp index 38ad7447c8..ca4fdc34ca 100644 --- a/src/activeznode.cpp +++ b/src/activeznode.cpp @@ -233,9 +233,9 @@ void CActiveZnode::ManageStateInitial() { CKey keyCollateral; // If collateral is found switch to LOCAL mode -// if (pwalletMain->GetZnodeVinAndKeys(vin, pubKeyCollateral, keyCollateral)) { -// eType = ZNODE_LOCAL; -// } + if (pwalletMain->GetZnodeVinAndKeys(vin, pubKeyCollateral, keyCollateral)) { + eType = ZNODE_LOCAL; + } LogPrint("znode", "CActiveZnode::ManageStateInitial -- End status = %s, type = %s, pinger enabled = %d\n", GetStatus(), GetTypeString(), fPingerEnabled); diff --git a/src/consensus/validation.h b/src/consensus/validation.h index 5af0a1b384..6990a012e9 100644 --- a/src/consensus/validation.h +++ b/src/consensus/validation.h @@ -23,6 +23,7 @@ static const unsigned char PUBCOIN_NOT_VALIDATE = 0x46; static const unsigned char NSEQUENCE_INCORRECT = 0x47; static const unsigned char PUBLIC_COIN_FOR_ACCUMULATOR_INVALID = 0x48; static const unsigned char NO_MINT_ZEROCOIN = 0x49; +static const unsigned char REJECT_INVALID_ZNODE_PAYMENT = 0x50; /** Capture information about block/transaction validation */ class CValidationState { diff --git a/src/main.cpp b/src/main.cpp index 64b6880017..b6ff405270 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1381,6 +1381,8 @@ bool CheckTransaction(const CTransaction &tx, CValidationState &state, uint256 h bool found_3 = false; bool found_4 = false; bool found_5 = false; + int total_payment_tx = 0; + bool found_znode_payment = true; // no more than 1 output for payment CScript FOUNDER_1_SCRIPT; CScript FOUNDER_2_SCRIPT; @@ -1411,8 +1413,7 @@ bool CheckTransaction(const CTransaction &tx, CValidationState &state, uint256 h FOUNDER_5_SCRIPT = GetScriptForDestination(CBitcoinAddress("TTtLk1iapn8QebamQcb8GEh1MNq8agYcVk").Get()); } - BOOST_FOREACH( - const CTxOut &output, tx.vout) { + BOOST_FOREACH(const CTxOut &output, tx.vout) { if (output.scriptPubKey == FOUNDER_1_SCRIPT && output.nValue == (int64_t)(2 * COIN)) { found_1 = true; } @@ -1430,6 +1431,7 @@ bool CheckTransaction(const CTransaction &tx, CValidationState &state, uint256 h } } } else if (!fTestNet || nHeight >= Params().GetConsensus().nZnodePaymentsStartBlock) { + if (!fTestNet && GetAdjustedTime() > nStartRewardTime) { FOUNDER_1_SCRIPT = GetScriptForDestination(CBitcoinAddress("aCAgTPgtYcA4EysU4UKC86EQd5cTtHtCcr").Get()); if (nHeight < 14000) { @@ -1453,21 +1455,32 @@ bool CheckTransaction(const CTransaction &tx, CValidationState &state, uint256 h FOUNDER_5_SCRIPT = GetScriptForDestination(CBitcoinAddress("TTtLk1iapn8QebamQcb8GEh1MNq8agYcVk").Get()); } + CAmount znodePayment = GetZnodePayment(nHeight); BOOST_FOREACH(const CTxOut &output, tx.vout) { if (output.scriptPubKey == FOUNDER_1_SCRIPT && output.nValue == (int64_t)(1 * COIN)) { found_1 = true; + continue; } if (output.scriptPubKey == FOUNDER_2_SCRIPT && output.nValue == (int64_t)(1 * COIN)) { found_2 = true; + continue; } if (output.scriptPubKey == FOUNDER_3_SCRIPT && output.nValue == (int64_t)(1 * COIN)) { found_3 = true; + continue; } if (output.scriptPubKey == FOUNDER_4_SCRIPT && output.nValue == (int64_t)(1 * COIN)) { found_4 = true; + continue; } if (output.scriptPubKey == FOUNDER_5_SCRIPT && output.nValue == (int64_t)(3 * COIN)) { found_5 = true; + continue; + } + if (znodePayment != output.nValue) { + found_znode_payment = false; + } else { + total_payment_tx = total_payment_tx + 1; } } } @@ -1476,6 +1489,11 @@ bool CheckTransaction(const CTransaction &tx, CValidationState &state, uint256 h return state.DoS(100, false, REJECT_FOUNDER_REWARD_MISSING, "CTransaction::CheckTransaction() : founders reward missing"); } + + if (!found_znode_payment || total_payment_tx > 1) { + return state.DoS(100, false, REJECT_INVALID_ZNODE_PAYMENT, + "CTransaction::CheckTransaction() : invalid znode payment"); + } } } else { BOOST_FOREACH(const CTxIn &txin, tx.vin) @@ -3640,7 +3658,7 @@ CAmount GetZnodePayment(int nHeight, CAmount blockValue) { // if (nHeight > nMNPIBlock + (nMNPIPeriod * 6)) ret += blockValue / 40; // 261680 - 45.0% - 2015-05-01 // if (nHeight > nMNPIBlock + (nMNPIPeriod * 7)) ret += blockValue / 40; // 278960 - 47.5% - 2015-06-01 // if (nHeight > nMNPIBlock + (nMNPIPeriod * 9)) ret += blockValue / 40; // 313520 - 50.0% - 2015-08-03 - CAmount ret = 15; //15XZC + CAmount ret = 15 * COIN; //15XZC return ret; } @@ -8005,14 +8023,14 @@ bool SendMessages(CNode *pto) { // // Message: inventory // - vector vInv; + vector vInv; + vector vInvWait; { LOCK(pto->cs_inventory); vInv.reserve(std::max(pto->vInventoryBlockToSend.size(), INVENTORY_BROADCAST_MAX)); // Add blocks - BOOST_FOREACH( - const uint256 &hash, pto->vInventoryBlockToSend) { + BOOST_FOREACH(const uint256 &hash, pto->vInventoryBlockToSend) { vInv.push_back(CInv(MSG_BLOCK, hash)); if (vInv.size() == MAX_INV_SZ) { pto->PushMessage(NetMsgType::INV, vInv); @@ -8134,6 +8152,27 @@ bool SendMessages(CNode *pto) { } } } + // vInventoryToSend from dash + { + LOCK(pto->cs_inventory); + vInv.reserve(std::min(1000, pto->vInventoryToSend.size())); + vInvWait.reserve(pto->vInventoryToSend.size()); + BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend) + { + pto->filterInventoryKnown.insert(inv.hash); + + LogPrintf("SendMessages -- queued inv: %s index=%d peer=%d\n", inv.ToString(), vInv.size(), pto->id); + vInv.push_back(inv); + if (vInv.size() >= 1000) + { + LogPrintf("SendMessages -- pushing inv's: count=%d peer=%d\n", vInv.size(), pto->id); + pto->PushMessage(NetMsgType::INV, vInv); + vInv.clear(); + } + } + pto->vInventoryToSend = vInvWait; + } + if (!vInv.empty()) pto->PushMessage(NetMsgType::INV, vInv); diff --git a/src/main.h b/src/main.h index 6a45435898..0fb175cacd 100644 --- a/src/main.h +++ b/src/main.h @@ -528,7 +528,7 @@ int GetUTXOHeight(const COutPoint& outpoint); int GetInputAge(const CTxIn &txin); int GetInputAgeIX(const uint256 &nTXHash, const CTxIn &txin); int GetIXConfirmations(const uint256 &nTXHash); -CAmount GetZnodePayment(int nHeight, CAmount blockValue); +CAmount GetZnodePayment(int nHeight, CAmount blockValue = 50 * COIN); /** Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) */ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true); diff --git a/src/miner.cpp b/src/miner.cpp index 22e5ab8225..ad6df8b72e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -485,7 +485,9 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn) // Update coinbase transaction with additional info about masternode and governance payments, // get some info back to pass to getblocktemplate if (nHeight >= chainparams.GetConsensus().nZnodePaymentsStartBlock) { - FillBlockPayments(coinbaseTx, nHeight, blockReward, pblock->txoutZnode, pblock->voutSuperblock); + CAmount znodePayment = GetZnodePayment(nHeight, blockReward); + FillBlockPayments(coinbaseTx, nHeight, znodePayment, pblock->txoutZnode, pblock->voutSuperblock); + coinbaseTx.vout[0].nValue -= znodePayment; } nLastBlockTx = nBlockTx; diff --git a/src/miner.h b/src/miner.h index c39ae4266e..b2d07670ae 100644 --- a/src/miner.h +++ b/src/miner.h @@ -168,7 +168,6 @@ class BlockAssembler BlockAssembler(const CChainParams& chainparams); /** Construct a new block template with coinbase to scriptPubKeyIn */ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn); - CBlockTemplate* CreateNewBlock_(const CScript& scriptPubKeyIn); CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey); private: diff --git a/src/net.cpp b/src/net.cpp index dde4836a0d..2206188046 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2102,8 +2102,11 @@ void RelayInv(CInv &inv, const int minProtoVersion) { LogPrintf("RelayInv, vNodes.size()=%s\n", vNodes.size()); BOOST_FOREACH(CNode * pnode, vNodes) { - if (pnode->nVersion >= minProtoVersion) + LogPrintf("pnode->nVersion=%s\n", pnode->nVersion); + LogPrintf("minProtoVersion=%s\n", minProtoVersion); + if (pnode->nVersion >= minProtoVersion) { pnode->PushInventory(inv); + } } } diff --git a/src/net.h b/src/net.h index eeaf5b6571..f81b605302 100644 --- a/src/net.h +++ b/src/net.h @@ -410,6 +410,7 @@ class CNode // inventory based relay CRollingBloomFilter filterInventoryKnown; + std::vector vInventoryToSend; // Set of transaction ids we still have to announce. // They are sorted by the mempool before relay, so the order is not important. std::set setInventoryTxToSend; @@ -555,6 +556,8 @@ class CNode } } else if (inv.type == MSG_BLOCK) { vInventoryBlockToSend.push_back(inv.hash); + } else { + vInventoryToSend.push_back(inv); } } diff --git a/src/protocol.cpp b/src/protocol.cpp index fb78c21fc2..151758242c 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -48,12 +48,6 @@ namespace NetMsgType { const char *ZNODEPAYMENTVOTE = "mnw"; const char *ZNODEPAYMENTBLOCK = "mnwb"; const char *ZNODEPAYMENTSYNC = "mnget"; - const char *MNBUDGETSYNC = "mnvs"; // depreciated since 12.1 - const char *MNBUDGETVOTE = "mvote"; // depreciated since 12.1 - const char *MNBUDGETPROPOSAL = "mprop"; // depreciated since 12.1 - const char *MNBUDGETFINAL = "fbs"; // depreciated since 12.1 - const char *MNBUDGETFINALVOTE = "fbvote"; // depreciated since 12.1 - const char *MNQUORUM = "mn quorum"; // not implemented const char *MNANNOUNCE = "mnb"; const char *MNPING = "mnp"; const char *DSACCEPT = "dsa"; @@ -66,34 +60,10 @@ namespace NetMsgType { const char *DSQUEUE = "dsq"; const char *DSEG = "dseg"; const char *SYNCSTATUSCOUNT = "ssc"; - const char *MNGOVERNANCESYNC = "govsync"; - const char *MNGOVERNANCEOBJECT = "govobj"; - const char *MNGOVERNANCEOBJECTVOTE = "govobjvote"; const char *MNVERIFY = "mnv"; const char *TXLOCKREQUEST = "ix"; }; -static const char *ppszTypeName[] = - { - "ERROR", // Should never occur - NetMsgType::TX, - NetMsgType::BLOCK, - "filtered block", // Should never occur - // Dash message types - // NOTE: include non-implmented here, we must keep this list in sync with enum in protocol.h - NetMsgType::TXLOCKREQUEST, - NetMsgType::TXLOCKVOTE, - NetMsgType::SPORK, - NetMsgType::ZNODEPAYMENTVOTE, - NetMsgType::ZNODEPAYMENTBLOCK, // reusing, was MNSCANERROR previousely, was NOT used in 12.0, we need this for inv - NetMsgType::MNQUORUM, // not implemented - NetMsgType::MNANNOUNCE, - NetMsgType::MNPING, - NetMsgType::DSTX, - NetMsgType::MNGOVERNANCEOBJECT, - NetMsgType::MNGOVERNANCEOBJECTVOTE, - NetMsgType::MNVERIFY, - }; /** All known message types. Keep this in the same order as the list of * messages above and in protocol.h. @@ -143,9 +113,6 @@ const static std::string allNetMessageTypes[] = { NetMsgType::DSQUEUE, NetMsgType::DSEG, NetMsgType::SYNCSTATUSCOUNT, - NetMsgType::MNGOVERNANCESYNC, - NetMsgType::MNGOVERNANCEOBJECT, - NetMsgType::MNGOVERNANCEOBJECTVOTE, NetMsgType::MNVERIFY, }; @@ -220,52 +187,50 @@ CInv::CInv(int typeIn, const uint256 &hashIn) { hash = hashIn; } -CInv::CInv(const std::string &strType, const uint256 &hashIn) { - unsigned int i; - for (i = 1; i < ARRAYLEN(ppszTypeName); i++) { - if (strType == ppszTypeName[i]) { - type = i; - break; - } - } - if (i == ARRAYLEN(ppszTypeName)) - throw std::out_of_range(strprintf("CInv::CInv(string, uint256): unknown type '%s'", strType)); - hash = hashIn; -} - bool operator<(const CInv &a, const CInv &b) { return (a.type < b.type || (a.type == b.type && a.hash < b.hash)); } -//bool CInv::IsKnownType() const { -// return (type >= 1 && type < (int) ARRAYLEN(ppszTypeName)); -//} - const char* CInv::GetCommand() const { std::string cmd; + LogPrintf("type=%s\n", type); if (type & MSG_WITNESS_FLAG) cmd.append("witness-"); - int masked = type & MSG_TYPE_MASK; - switch (masked) +// int masked = type & MSG_TYPE_MASK; +// LogPrintf("masked=%s\n", masked); +// LogPrintf("MSG_TX=%s\n", MSG_TX); +// LogPrintf("MSG_BLOCK=%s\n", MSG_BLOCK); +// LogPrintf("MSG_FILTERED_BLOCK=%s\n", MSG_FILTERED_BLOCK); +// LogPrintf("MSG_CMPCT_BLOCK=%s\n", MSG_CMPCT_BLOCK); +// LogPrintf("MSG_TXLOCK_REQUEST=%s\n", MSG_TXLOCK_REQUEST); +// LogPrintf("MSG_TXLOCK_VOTE=%s\n", MSG_TXLOCK_VOTE); +// LogPrintf("MSG_SPORK=%s\n", MSG_SPORK); +// LogPrintf("MSG_ZNODE_PAYMENT_VOTE=%s\n", MSG_ZNODE_PAYMENT_VOTE); +// LogPrintf("MSG_ZNODE_ANNOUNCE=%s\n", MSG_ZNODE_ANNOUNCE); +// LogPrintf("MSG_ZNODE_PING=%s\n", MSG_ZNODE_PING); +// LogPrintf("MSG_DSTX=%s\n", MSG_DSTX); +// LogPrintf("MSG_ZNODE_VERIFY=%s\n", MSG_ZNODE_VERIFY); + switch (type) { - case MSG_TX: return NetMsgType::TX; - case MSG_BLOCK: return NetMsgType::BLOCK; - case MSG_FILTERED_BLOCK: return NetMsgType::MERKLEBLOCK; - case MSG_CMPCT_BLOCK: return NetMsgType::CMPCTBLOCK; - case MSG_TXLOCK_REQUEST: return NetMsgType::TXLOCKREQUEST; - case MSG_TXLOCK_VOTE: return NetMsgType::TXLOCKVOTE; - case MSG_SPORK: return NetMsgType::SPORK; - case MSG_ZNODE_PAYMENT_VOTE: return NetMsgType::ZNODEPAYMENTVOTE; - case MSG_ZNODE_PAYMENT_BLOCK: return NetMsgType::ZNODEPAYMENTBLOCK; - case MSG_ZNODE_ANNOUNCE: return NetMsgType::MNANNOUNCE; - case MSG_ZNODE_PING: return NetMsgType::MNPING; - case MSG_DSTX: return NetMsgType::DSTX; - case MSG_ZNODE_VERIFY: return NetMsgType::MNVERIFY; - default: - LogPrintf("ERROR - UNKNOWN INV COMMAND"); - return NULL; -// throw std::out_of_range(strprintf("CInv::GetCommand(): type=%d unknown type", type)); + case MSG_TX: return NetMsgType::TX; + case MSG_BLOCK: return NetMsgType::BLOCK; + case MSG_FILTERED_BLOCK: return NetMsgType::MERKLEBLOCK; + case MSG_CMPCT_BLOCK: return NetMsgType::CMPCTBLOCK; + case MSG_TXLOCK_REQUEST: return NetMsgType::TXLOCKREQUEST; + case MSG_TXLOCK_VOTE: return NetMsgType::TXLOCKVOTE; + case MSG_SPORK: return NetMsgType::SPORK; + case MSG_ZNODE_PAYMENT_VOTE: return NetMsgType::ZNODEPAYMENTVOTE; + case MSG_ZNODE_PAYMENT_BLOCK: return NetMsgType::ZNODEPAYMENTBLOCK; + case MSG_ZNODE_ANNOUNCE: return NetMsgType::MNANNOUNCE; + case MSG_ZNODE_PING: return NetMsgType::MNPING; + case MSG_DSTX: return NetMsgType::DSTX; + case MSG_ZNODE_VERIFY: return NetMsgType::MNVERIFY; + default: { + LogPrintf("ERROR - UNKNOWN INV COMMAND\n"); + return NetMsgType::NOTFOUND; + } + // throw std::out_of_range(strprintf("CInv::GetCommand(): type=%d unknown type", type)); } } diff --git a/src/protocol.h b/src/protocol.h index 695caf4ce8..0d2de92c2a 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -250,12 +250,12 @@ extern const char *GETSPORKS; extern const char *ZNODEPAYMENTVOTE; extern const char *ZNODEPAYMENTSYNC; extern const char *SYNCSTATUSCOUNT; -extern const char *DSEG; extern const char *MNVERIFY; extern const char *MNPING; extern const char *MNANNOUNCE; extern const char *DSACCEPT; extern const char *DSQUEUE; +extern const char *DSEG; extern const char *DSVIN; extern const char *DSSTATUSUPDATE; extern const char *DSSIGNFINALTX; @@ -341,7 +341,7 @@ const uint32_t MSG_TYPE_MASK = 0xffffffff >> 2; enum GetDataMsg { UNDEFINED = 0, - MSG_TX, + MSG_TX = 1, MSG_BLOCK, MSG_TYPE_MAX = MSG_BLOCK, // The following can only occur in getdata. Invs always use TX or BLOCK. @@ -353,7 +353,6 @@ enum GetDataMsg MSG_SPORK, MSG_ZNODE_PAYMENT_VOTE, MSG_ZNODE_PAYMENT_BLOCK, - MSG_ZNODE_QUORUM, // not implemented MSG_ZNODE_ANNOUNCE, MSG_ZNODE_PING, MSG_ZNODE_VERIFY, @@ -368,7 +367,7 @@ class CInv { public: CInv(); - CInv(const std::string& strType, const uint256& hashIn); +// CInv(const std::string& strType, const uint256& hashIn); CInv(int typeIn, const uint256& hashIn); ADD_SERIALIZE_METHODS; diff --git a/src/znode-payments.cpp b/src/znode-payments.cpp index 95700ed236..e7413f41d8 100644 --- a/src/znode-payments.cpp +++ b/src/znode-payments.cpp @@ -207,7 +207,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc return true; } -void FillBlockPayments(CMutableTransaction& txNew, int nBlockHeight, CAmount blockReward, CTxOut& txoutZnodeRet, std::vector& voutSuperblockRet) +void FillBlockPayments(CMutableTransaction& txNew, int nBlockHeight, CAmount znodePayment, CTxOut& txoutZnodeRet, std::vector& voutSuperblockRet) { // only create superblocks if spork is enabled AND if superblock is actually triggered // (height should be validated inside) @@ -219,9 +219,9 @@ void FillBlockPayments(CMutableTransaction& txNew, int nBlockHeight, CAmount blo // } // FILL BLOCK PAYEE WITH ZNODE PAYMENT OTHERWISE - mnpayments.FillBlockPayee(txNew, nBlockHeight, blockReward, txoutZnodeRet); - LogPrint("mnpayments", "FillBlockPayments -- nBlockHeight %d blockReward %lld txoutZnodeRet %s txNew %s", - nBlockHeight, blockReward, txoutZnodeRet.ToString(), txNew.ToString()); + mnpayments.FillBlockPayee(txNew, nBlockHeight, znodePayment, txoutZnodeRet); + LogPrint("mnpayments", "FillBlockPayments -- nBlockHeight %d znodePayment %lld txoutZnodeRet %s txNew %s", + nBlockHeight, znodePayment, txoutZnodeRet.ToString(), txNew.ToString()); } std::string GetRequiredPaymentsString(int nBlockHeight) @@ -261,7 +261,7 @@ bool CZnodePayments::CanVote(COutPoint outZnode, int nBlockHeight) * Fill Znode ONLY payment block */ -void CZnodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockHeight, CAmount blockReward, CTxOut& txoutZnodeRet) +void CZnodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockHeight, CAmount znodePayment, CTxOut& txoutZnodeRet) { // make sure it's not filled yet txoutZnodeRet = CTxOut(); @@ -281,11 +281,6 @@ void CZnodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockHeight payee = GetScriptForDestination(winningNode->pubKeyCollateralAddress.GetID()); } - // GET ZNODE PAYMENT VARIABLES SETUP - CAmount znodePayment = GetZnodePayment(nBlockHeight, blockReward); - - // split reward between miner ... - txNew.vout[0].nValue -= znodePayment; // ... and znode txoutZnodeRet = CTxOut(znodePayment, payee); txNew.vout.push_back(txoutZnodeRet); diff --git a/src/znode-sync.cpp b/src/znode-sync.cpp index 57b270bfd3..b2b2fbf58d 100644 --- a/src/znode-sync.cpp +++ b/src/znode-sync.cpp @@ -152,8 +152,6 @@ std::string CZnodeSync::GetAssetName() { return "ZNODE_SYNC_LIST"; case (ZNODE_SYNC_MNW): return "ZNODE_SYNC_MNW"; - case (ZNODE_SYNC_GOVERNANCE): - return "ZNODE_SYNC_GOVERNANCE"; case (ZNODE_SYNC_FAILED): return "ZNODE_SYNC_FAILED"; case ZNODE_SYNC_FINISHED: @@ -229,8 +227,6 @@ std::string CZnodeSync::GetSyncStatus() { return _("Synchronizing znodes..."); case ZNODE_SYNC_MNW: return _("Synchronizing znode payments..."); - case ZNODE_SYNC_GOVERNANCE: - return _("Synchronizing governance objects..."); case ZNODE_SYNC_FAILED: return _("Synchronization failed"); case ZNODE_SYNC_FINISHED: @@ -338,7 +334,6 @@ void CZnodeSync::ProcessTick() { } else if (nRequestedZnodeAttempt < 6) { int nMnCount = mnodeman.CountZnodes(); pnode->PushMessage(NetMsgType::ZNODEPAYMENTSYNC, nMnCount); //sync payment votes - SendGovernanceSyncRequest(pnode); } else { nRequestedZnodeAssets = ZNODE_SYNC_FINISHED; } @@ -513,7 +508,7 @@ void CZnodeSync::ProcessTick() { ReleaseNodeVector(vNodesCopy); } -void CZnodeSync::SendGovernanceSyncRequest(CNode *pnode) { +//void CZnodeSync::SendGovernanceSyncRequest(CNode *pnode) { // if(pnode->nVersion >= GOVERNANCE_FILTER_PROTO_VERSION) { // CBloomFilter filter; // filter.clear(); @@ -523,7 +518,7 @@ void CZnodeSync::SendGovernanceSyncRequest(CNode *pnode) { // else { // pnode->PushMessage(NetMsgType::MNGOVERNANCESYNC, uint256()); // } -} +//} void CZnodeSync::UpdatedBlockTip(const CBlockIndex *pindex) { pCurrentBlockIndex = pindex; diff --git a/src/znode-sync.h b/src/znode-sync.h index 016c72a81c..7103194885 100644 --- a/src/znode-sync.h +++ b/src/znode-sync.h @@ -16,7 +16,7 @@ static const int ZNODE_SYNC_INITIAL = 0; static const int ZNODE_SYNC_SPORKS = 1; static const int ZNODE_SYNC_LIST = 2; static const int ZNODE_SYNC_MNW = 3; -static const int ZNODE_SYNC_GOVERNANCE = 4; +//static const int ZNODE_SYNC_GOVERNANCE = 4; static const int ZNODE_SYNC_GOVOBJ = 10; static const int ZNODE_SYNC_GOVOBJ_VOTE = 11; static const int ZNODE_SYNC_FINISHED = 999; diff --git a/src/znode.h b/src/znode.h index 8e35e652fe..ec8032134d 100644 --- a/src/znode.h +++ b/src/znode.h @@ -17,9 +17,8 @@ class CZnodeBroadcast; class CZnodePing; static const int ZNODE_CHECK_SECONDS = 5; -//static const int ZNODE_MIN_MNB_SECONDS = 5 * 60; -static const int ZNODE_MIN_MNB_SECONDS = 1 * 60; -static const int ZNODE_MIN_MNP_SECONDS = 1 * 60; +static const int ZNODE_MIN_MNB_SECONDS = 5 * 60; +static const int ZNODE_MIN_MNP_SECONDS = 5 * 60; //static const int ZNODE_MIN_MNP_SECONDS = 10 * 60; static const int ZNODE_EXPIRATION_SECONDS = 65 * 60; static const int ZNODE_WATCHDOG_MAX_SECONDS = 120 * 60;