From 09c7bdb6ec44b836b9d5cffb1464ccd769bc9d71 Mon Sep 17 00:00:00 2001 From: tvle83 Date: Wed, 16 Jan 2019 18:05:54 -0600 Subject: [PATCH 1/3] Enabling BIP130 --- src/chainparams.cpp | 2 +- src/chainparams.h | 3 --- src/main.cpp | 18 ++++++++++-------- src/miner.cpp | 2 ++ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 13dfec7..563f0b3 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -234,7 +234,7 @@ class CMainParams : public CChainParams fMineBlocksOnDemand = false; fSkipProofOfWorkCheck = false; fTestnetToBeDeprecatedFieldRPC = false; - fHeadersFirstSyncingActive = false; + nPoolMaxTransactions = 3; strSporkKey = "044a30edfb288d8973761070dc8b456d429c7b8872d475a837e09e71d3b710c08055852a50de199ee04c0643ebb4bce1c52a27c63cec13c62cf2f84eda00d8a3a6"; diff --git a/src/chainparams.h b/src/chainparams.h index c436e21..95196ce 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -62,8 +62,6 @@ class CChainParams const CBlock& GenesisBlock() const { return genesis; } /** Make miner wait to have peers to avoid wasting work */ bool MiningRequiresPeers() const { return fMiningRequiresPeers; } - /** Headers first syncing is disabled */ - bool HeadersFirstSyncingActive() const { return fHeadersFirstSyncingActive; }; /** Default value for -checkmempool and -checkblockindex argument */ bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; } /** Allow mining of a min-difficulty block */ @@ -154,7 +152,6 @@ class CChainParams bool fMineBlocksOnDemand; bool fSkipProofOfWorkCheck; bool fTestnetToBeDeprecatedFieldRPC; - bool fHeadersFirstSyncingActive; int nPoolMaxTransactions; std::string strSporkKey; std::string strObfuscationPoolDummyAddress; diff --git a/src/main.cpp b/src/main.cpp index 7578831..cfd4c5f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5762,8 +5762,7 @@ bool fRequestedSporksIDB = false; bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived) { RandAddSeedPerfmon(); - if (fDebug) - LogPrintf("received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->id); + LogPrint("net", "received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->id); if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) { LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n"); return true; @@ -6053,7 +6052,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "getblocks" || strCommand == "getheaders") { + else if (strCommand == "getblocks") { CBlockLocator locator; uint256 hashStop; vRecv >> locator >> hashStop; @@ -6085,15 +6084,17 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "headers" && Params().HeadersFirstSyncingActive()) { + else if (strCommand == "headers") { CBlockLocator locator; uint256 hashStop; vRecv >> locator >> hashStop; LOCK(cs_main); - if (IsInitialBlockDownload()) + if (IsInitialBlockDownload() && !pfrom->fWhitelisted) { + LogPrint("net", "Ignoring getheaders from peer=%d because node is in initial block download\n", pfrom->id); return true; + } CBlockIndex* pindex = NULL; if (locator.IsNull()) { @@ -6112,8 +6113,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end vector vHeaders; int nLimit = MAX_HEADERS_RESULTS; - if (fDebug) - LogPrintf("getheaders %d to %s from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString(), pfrom->id); + + LogPrint("net", "getheaders %d to %s from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString(), pfrom->id); + for (; pindex; pindex = chainActive.Next(pindex)) { vHeaders.push_back(pindex->GetBlockHeader()); if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop) @@ -6290,7 +6292,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "headers" && Params().HeadersFirstSyncingActive() && !fImporting && !fReindex) // Ignore headers received while importing + else if (strCommand == "headers" && !fImporting && !fReindex) // Ignore headers received while importing { std::vector headers; diff --git a/src/miner.cpp b/src/miner.cpp index aa3ccfa..75d3b7e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -585,6 +585,7 @@ void BitcoinMiner(CWallet* pwallet, bool fProofOfStake) while (chainActive.Tip()->nTime < 1471482000 || vNodes.empty() || pwallet->IsLocked() || !fMintableCoins || nReserveBalance >= pwallet->GetBalance() || !masternodeSync.IsSynced()) { nLastCoinStakeSearchInterval = 0; + LogPrint("miner", "MNPCoinMiner wait 5 seconds (%u, %d, %d, %d)\n", vNodes.size(), pwallet->IsLocked(), fMintableCoins, masternodeSync.IsBlockchainSynced()); MilliSleep(5000); if (!fGenerateBitcoins && !fProofOfStake) continue; @@ -594,6 +595,7 @@ void BitcoinMiner(CWallet* pwallet, bool fProofOfStake) { if (GetTime() - mapHashedBlocks[chainActive.Tip()->nHeight] < max(pwallet->nHashInterval, (unsigned int)1)) // wait half of the nHashDrift with max wait of 3 minutes { + LogPrint("miner", "MNPCoinMiner wait half of the nHashDrift\n"); MilliSleep(5000); continue; } From fb8e6db173dfd21b10651407dc6c9986b0342bdd Mon Sep 17 00:00:00 2001 From: tvle83 Date: Sat, 19 Jan 2019 19:26:08 -0600 Subject: [PATCH 2/3] Removed turning on spork in code because it isn't required. --- src/spork.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spork.h b/src/spork.h index fbc8ea4..c4bc20e 100644 --- a/src/spork.h +++ b/src/spork.h @@ -47,14 +47,14 @@ using namespace boost; #define SPORK_3_SWIFTTX_BLOCK_FILTERING_DEFAULT 1424217600 //2015-2-18 #define SPORK_5_MAX_VALUE_DEFAULT 1000 //1000 MNP #define SPORK_7_MASTERNODE_SCANNING_DEFAULT 978307200 //2001-1-1 -#define SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT_DEFAULT 1535904000 // Activated - Sun Sep 2 16:00:00 2018 +#define SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT_DEFAULT 4070908800 //OFF #define SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT_DEFAULT 4070908800 //OFF #define SPORK_10_MASTERNODE_PAY_UPDATED_NODES_DEFAULT 4070908800 //OFF //#define SPORK_11_LOCK_INVALID_UTXO_DEFAULT 4070908800 //OFF - NOTE: this is block height not time! #define SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT 4070908800 //OFF #define SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT 4070908800 //OFF #define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT 4070908800 //OFF -#define SPORK_16_ZEROCOIN_MAINTENANCE_MODE_DEFAULT 1539263208 // activated - Thu Oct 11 13:06:48 2018 +#define SPORK_16_ZEROCOIN_MAINTENANCE_MODE_DEFAULT 4070908800 //OFF class CSporkMessage; class CSporkManager; From 551dc384d64aabc752a7bd3bc423c7b35e974c42 Mon Sep 17 00:00:00 2001 From: tvle83 Date: Sat, 19 Jan 2019 19:26:50 -0600 Subject: [PATCH 3/3] Updated Readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ac383ff..d341f29 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Website: https://mnpcoin.pro Utility: https://masternodes.pro -#### 01-13-19 ----- __Spork Protocol Update Enforced Feb 1, 2019__ +#### 01-19-19 + - Implemented BIP130 - Removed Zerocoin options from transaction dropdown. - Updated Copyright dates and minor cleanup of code.