From ac913c02589b30abba0430644154aa1124a05a47 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 24 May 2016 12:20:10 -0700 Subject: [PATCH] Removed unimplemented commands / mnquorum / mnscanerror - Scanning errors should be implemented via sentinel --- src/masternode-sync.cpp | 47 ++++++++++++++++++++++++++++++++++++++--- src/protocol.cpp | 6 ------ src/protocol.h | 2 -- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 8babca6ac3..fc8dfd91d0 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -213,6 +213,7 @@ void CMasternodeSync::Process() int nMnCount = mnodeman.CountEnabled(); // RESET SYNCING INCASE OF FAILURE + { if(IsSynced()) { /* @@ -286,7 +287,8 @@ void CMasternodeSync::Process() if (pnode->nVersion >= mnpayments.GetMinMasternodePaymentsProto()) { - // MODE : MASTERNODE_SYNC_LIST + // SYNC MASTERNODE LIST FROM OTHER CONNECTED CLIENTS + if(RequestedMasternodeAssets == MASTERNODE_SYNC_LIST) { // shall we move onto the next asset? @@ -315,7 +317,8 @@ void CMasternodeSync::Process() return; //this will cause each peer to get one request each six seconds for the various assets we need } - // MODE : MASTERNODE_SYNC_MNW + // SYNC MASTERNODE WINNERS FROM OTHER CONNECTED CLIENTS + if(RequestedMasternodeAssets == MASTERNODE_SYNC_MNW) { // Shall we move onto the next asset? @@ -350,8 +353,46 @@ void CMasternodeSync::Process() return; //this will cause each peer to get one request each six seconds for the various assets we need } - } + + // if (pnode->nVersion >= MIN_BUDGET_PEER_PROTO_VERSION) { + // // MODE : MASTERNODE_SYNC_BUDGET + // if(RequestedMasternodeAssets == MASTERNODE_SYNC_BUDGET){ + // // shall we move onto the next asset + // if(countBudgetItemProp > 0 && countBudgetItemFin) + // { + // if(governance.CountProposalInventoryItems() >= (sumBudgetItemProp / countBudgetItemProp)*0.9) + // { + // if(governance.CountFinalizedInventoryItems() >= (sumBudgetItemFin / countBudgetItemFin)*0.9) + // { + // GetNextAsset(); + // return; + // } + // } + // } + + // //we'll start rejecting votes if we accidentally get set as synced too soon, this allows plenty of time + // if(lastBudgetItem < GetTime() - MASTERNODE_SYNC_TIMEOUT){ + // GetNextAsset(); + + // //try to activate our masternode if possible + // activeMasternode.ManageStatus(); + // return; + // } + + // // requesting is the last thing we do, incase we needed to move to the next asset and we've requested from each peer already + + // if(pnode->HasFulfilledRequest("busync")) continue; + // pnode->FulfilledRequest("busync"); + + // uint256 n = uint256(); + // pnode->PushMessage(NetMsgType::MNBUDGETVOTESYNC, n); //sync masternode votes + // RequestedMasternodeAttempt++; + + // return; //this will cause each peer to get one request each six seconds for the various assets we need + // } + + // } } } diff --git a/src/protocol.cpp b/src/protocol.cpp index c3aa6143f4..6476d3b6c1 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -42,13 +42,11 @@ const char *SPORK="spork"; const char *GETSPORKS="getsporks"; const char *MNWINNER="mnw"; const char *MNWINNERSSYNC="mnget"; -const char *MNSCANERROR="mn scan error"; // TODO ??? const char *MNGOVERNANCEVOTESYNC="mnvs"; const char *MNGOVERNANCEVOTE="mvote"; const char *MNGOVERNANCEPROPOSAL="mprop"; const char *MNGOVERNANCEFINAL="fbs"; const char *MNGOVERNANCEFINALVOTE="fbvote"; -const char *MNQUORUM="mn quorum"; // TODO ??? const char *MNANNOUNCE="mnb"; const char *MNPING="mnp"; const char *DSACCEPT="dsa"; @@ -74,12 +72,10 @@ static const char* ppszTypeName[] = NetMsgType::IXLOCKVOTE, NetMsgType::SPORK, NetMsgType::MNWINNER, - NetMsgType::MNSCANERROR, NetMsgType::MNGOVERNANCEVOTE, NetMsgType::MNGOVERNANCEPROPOSAL, NetMsgType::MNGOVERNANCEFINAL, NetMsgType::MNGOVERNANCEFINALVOTE, - NetMsgType::MNQUORUM, NetMsgType::MNANNOUNCE, NetMsgType::MNPING, NetMsgType::DSTX @@ -118,13 +114,11 @@ const static std::string allNetMessageTypes[] = { NetMsgType::GETSPORKS, NetMsgType::MNWINNER, NetMsgType::MNWINNERSSYNC, - NetMsgType::MNSCANERROR, NetMsgType::MNGOVERNANCEVOTESYNC, NetMsgType::MNGOVERNANCEVOTE, NetMsgType::MNGOVERNANCEPROPOSAL, NetMsgType::MNGOVERNANCEFINAL, NetMsgType::MNGOVERNANCEFINALVOTE, - NetMsgType::MNQUORUM, NetMsgType::MNANNOUNCE, NetMsgType::MNPING, NetMsgType::DSACCEPT, diff --git a/src/protocol.h b/src/protocol.h index de6f0b72e5..5dcbe3615f 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -227,13 +227,11 @@ extern const char *SPORK; extern const char *GETSPORKS; extern const char *MNWINNER; extern const char *MNWINNERSSYNC; -extern const char *MNSCANERROR; extern const char *MNGOVERNANCEVOTESYNC; extern const char *MNGOVERNANCEVOTE; extern const char *MNGOVERNANCEPROPOSAL; extern const char *MNGOVERNANCEFINAL; extern const char *MNGOVERNANCEFINALVOTE; -extern const char *MNQUORUM; extern const char *MNANNOUNCE; extern const char *MNPING; extern const char *DSACCEPT;