diff --git a/configure.ac b/configure.ac index 5e9ba469b7c50..e061870bb75fa 100644 --- a/configure.ac +++ b/configure.ac @@ -2,10 +2,10 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 12) -define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 3) +define(_CLIENT_VERSION_REVISION, 3) +define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2017) +define(_COPYRIGHT_YEAR, 2018) AC_INIT([Paccoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/paccoinpay/paccoin/issues],[paccoincore]) AC_CONFIG_SRCDIR([src/validation.cpp]) AC_CONFIG_HEADERS([src/config/paccoin-config.h]) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index ecccbad314145..f0c5da00c1e0a 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -120,7 +120,13 @@ bool CActiveMasternode::SendMasternodePing(CConnman& connman) bool CActiveMasternode::UpdateSentinelPing(int version) { nSentinelVersion = version; + if(version < MIN_SENTINEL_VERSION ){ + LogPrintf("CActiveMasternode::UpdateSentinelPing -- Sentinel is out of date please update. Version = %s\n", SafeIntVersionToString(version)); + return false; + } + nSentinelPingTime = GetAdjustedTime(); + LogPrint("masternode", "CActiveMasternode::UpdateSentinelPing -- Updated Sentinel Version = %s PingTime = %d\n", SafeIntVersionToString(nSentinelVersion), nSentinelPingTime); return true; } @@ -197,7 +203,7 @@ void CActiveMasternode::ManageStateInitial(CConnman& connman) void CActiveMasternode::ManageStateRemote() { - LogPrint("masternode", "CActiveMasternode::ManageStateRemote -- Start status = %s, type = %s, pinger enabled = %d, pubKeyMasternode.GetID() = %s\n", + LogPrint("masternode", "CActiveMasternode::ManageStateRemote -- Start status = %s, type = %s, pinger enabled = %d, pubKeyMasternode.GetID() = %s\n", GetStatus(), GetTypeString(), fPingerEnabled, pubKeyMasternode.GetID().ToString()); mnodeman.CheckMasternode(pubKeyMasternode, true); diff --git a/src/chainparams.cpp b/src/chainparams.cpp index fea83d807d0ec..697d519630679 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -120,8 +120,8 @@ class CMainParams : public CChainParams { strNetworkID = "main"; consensus.nSubsidyHalvingInterval = 210240; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050) consensus.nMasternodePaymentsStartBlock = 200; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock - consensus.nMasternodePaymentsIncreaseBlock = 158000; // actual historical value - consensus.nMasternodePaymentsIncreasePeriod = 576*30; // 17280 - actual historical value + consensus.nMasternodePaymentsIncreaseBlock = 50000; // 50000 height aproximately April 20th + consensus.nMasternodePaymentsIncreasePeriod = 576*30; // Not used consensus.nInstantSendKeepLock = 24; consensus.nBudgetPaymentsStartBlock = 200; // actual historical value consensus.nBudgetPaymentsCycleBlocks = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725 @@ -241,7 +241,7 @@ class CTestNetParams : public CChainParams { strNetworkID = "test"; consensus.nSubsidyHalvingInterval = 210240; consensus.nMasternodePaymentsStartBlock = 2; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock - consensus.nMasternodePaymentsIncreaseBlock = 4030; + consensus.nMasternodePaymentsIncreaseBlock = 6200; consensus.nMasternodePaymentsIncreasePeriod = 10; consensus.nInstantSendKeepLock = 6; consensus.nBudgetPaymentsStartBlock = 2; diff --git a/src/clientversion.h b/src/clientversion.h index bcd47d477b966..32465acdaa4f7 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -16,8 +16,8 @@ //! These need to be macros, as clientversion.cpp's and paccoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 12 -#define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 3 +#define CLIENT_VERSION_REVISION 3 +#define CLIENT_VERSION_BUILD 0 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true @@ -26,7 +26,7 @@ * Copyright year (2009-this) * Todo: update this when changing our copyright comments in the source */ -#define COPYRIGHT_YEAR 2017 +#define COPYRIGHT_YEAR 2018 #endif //HAVE_CONFIG_H diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 8603c2909b27d..bcaa7e18f0f34 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -282,7 +282,7 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockH } // GET MASTERNODE PAYMENT VARIABLES SETUP - CAmount masternodePayment = GetMasternodePayment(nBlockHeight, blockReward); + CAmount masternodePayment = GetMasternodePayment(nBlockHeight, blockReward, Params().GetConsensus()); // split reward between miner ... txNew.vout[0].nValue -= masternodePayment; @@ -549,7 +549,7 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew) int nMaxSignatures = 0; std::string strPayeesPossible = ""; - CAmount nMasternodePayment = GetMasternodePayment(nBlockHeight, txNew.GetValueOut()); + CAmount nMasternodePayment = GetMasternodePayment(nBlockHeight, txNew.GetValueOut(), Params().GetConsensus()); //require at least MNPAYMENTS_SIGNATURES_REQUIRED signatures diff --git a/src/masternode-payments.h b/src/masternode-payments.h index 1cf5d87491e1c..8ddda879096b7 100644 --- a/src/masternode-payments.h +++ b/src/masternode-payments.h @@ -24,7 +24,7 @@ static const int MNPAYMENTS_SIGNATURES_TOTAL = 10; // V1 - Last protocol version before update // V2 - Newest protocol version static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70206; -static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70208; +static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70213; extern CCriticalSection cs_vecPayees; extern CCriticalSection cs_mapMasternodeBlocks; diff --git a/src/masternode.cpp b/src/masternode.cpp index 2be5ba6864c0d..b27f03950f67c 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -324,7 +324,7 @@ void CMasternode::UpdateLastPaid(const CBlockIndex *pindex, int nMaxBlocksToScan if(!ReadBlockFromDisk(block, BlockReading, Params().GetConsensus())) // shouldn't really happen continue; - CAmount nMasternodePayment = GetMasternodePayment(BlockReading->nHeight, block.vtx[0].GetValueOut()); + CAmount nMasternodePayment = GetMasternodePayment(BlockReading->nHeight, block.vtx[0].GetValueOut(), Params().GetConsensus()); BOOST_FOREACH(CTxOut txout, block.vtx[0].vout) if(mnpayee == txout.scriptPubKey && nMasternodePayment == txout.nValue) { diff --git a/src/masternode.h b/src/masternode.h index 56462ba51739e..cb02cc4f229c5 100644 --- a/src/masternode.h +++ b/src/masternode.h @@ -29,6 +29,10 @@ static const int MASTERNODE_POSE_BAN_MAX_SCORE = 5; // sentinel version before sentinel ping implementation #define DEFAULT_SENTINEL_VERSION 0x010001 +// sentinel with voting fix to enable proposals +#define MIN_SENTINEL_VERSION 0x010200 + + class CMasternodePing { public: diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp index 2460c74ce673e..0e42b21be95e2 100644 --- a/src/rpc/governance.cpp +++ b/src/rpc/governance.cpp @@ -344,6 +344,16 @@ UniValue gobject(const UniValue& params, bool fHelp) return returnObj; } + if(mn.IsWatchdogExpired()) { + nFailed++; + statusObj.push_back(Pair("result", "failed")); + statusObj.push_back(Pair("errorMessage", "WATCHDOG_EXPIRED nodes aren't allowed to vote.")); + resultsObj.push_back(Pair("paccoin.conf", statusObj)); + returnObj.push_back(Pair("overall", strprintf("Voted successfully %d time(s) and failed %d time(s).", nSuccessful, nFailed))); + returnObj.push_back(Pair("detail", resultsObj)); + return returnObj; + } + CGovernanceVote vote(mn.vin.prevout, hash, eVoteSignal, eVoteOutcome); if(!vote.Sign(activeMasternode.keyMasternode, activeMasternode.pubKeyMasternode)) { nFailed++; diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 96e589b863cda..0d83d63f53d4a 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -846,6 +846,5 @@ UniValue sentinelping(const UniValue& params, bool fHelp) ); } - activeMasternode.UpdateSentinelPing(StringVersionToInt(params[0].get_str())); - return true; + return activeMasternode.UpdateSentinelPing(StringVersionToInt(params[0].get_str())); } diff --git a/src/validation.cpp b/src/validation.cpp index b7072eac321a9..fc7e5d210e287 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1239,7 +1239,7 @@ CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params& } else { dDiff = ConvertBitsToDouble(nPrevBits); } - + if (nPrevHeight < 100) { nSubsidyBase = 35500000; @@ -1260,17 +1260,23 @@ CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params& return fSuperblockPartOnly ? nSuperblockPart : nSubsidy - nSuperblockPart; } -CAmount GetMasternodePayment(int nHeight, CAmount blockValue) +CAmount GetMasternodePayment(int nHeight, CAmount blockValue, const Consensus::Params& consensusParams) { - double dMasternodePart = 9.0/16.0; - CAmount ret = blockValue * dMasternodePart; // 45% of the total block reward. - return ret; + double dMasternodePart; + + if(nHeight < consensusParams.nMasternodePaymentsIncreaseBlock){ + dMasternodePart = 9.0/16.0; // 56.25% of the block reward. + } else { + dMasternodePart = 15.0/16.0; // 93.75% of the block reward. + } + + return (blockValue * dMasternodePart); } double GetSubsidyMultiplier(int nPrevHeight, int nSubsidyAdjustmentInterval) { double dMultiplier = 0.0; - + if (nPrevHeight < 100) { dMultiplier = 1.0; } else if (nPrevHeight <= nSubsidyAdjustmentInterval * 1) { @@ -1292,7 +1298,7 @@ double GetSubsidyMultiplier(int nPrevHeight, int nSubsidyAdjustmentInterval) } else { dMultiplier = 0.0; } - + return dMultiplier; } @@ -3959,7 +3965,7 @@ bool LoadBlockIndex() return true; } -bool InitBlockIndex(const CChainParams& chainparams) +bool InitBlockIndex(const CChainParams& chainparams) { LOCK(cs_main); diff --git a/src/validation.h b/src/validation.h index 725c06ef1c5e9..841a827284a28 100644 --- a/src/validation.h +++ b/src/validation.h @@ -198,7 +198,7 @@ static const unsigned int DEFAULT_CHECKLEVEL = 3; // Setting the target to > than 945MB will make it likely we can respect the target. static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024; -/** +/** * Process an incoming block. This only returns after the best known valid * block is made active. Note that it does not, however, guarantee that the * specific block passed to it has been checked for validity! @@ -209,7 +209,7 @@ static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024; * * Note that we guarantee that either the proof-of-work is valid on pblock, or * (and possibly also) BlockChecked will have been called. - * + * * @param[in] pblock The block we want to process. * @param[in] fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers. * @param[out] dbp The already known disk position of pblock, or NULL if not yet stored. @@ -263,7 +263,7 @@ bool ActivateBestChain(CValidationState& state, const CChainParams& chainparams, double ConvertBitsToDouble(unsigned int nBits); CAmount GetBlockSubsidy(int nBits, int nHeight, const Consensus::Params& consensusParams, bool fSuperblockPartOnly = false); -CAmount GetMasternodePayment(int nHeight, CAmount blockValue); +CAmount GetMasternodePayment(int nHeight, CAmount blockValue, const Consensus::Params& consensusParams); double GetSubsidyMultiplier(int nPrevHeight, int nSubsidyAdjustmentInterval); /** @@ -318,7 +318,7 @@ unsigned int GetLegacySigOpCount(const CTransaction& tx); /** * Count ECDSA signature operations in pay-to-script-hash inputs. - * + * * @param[in] mapInputs Map of previous transactions that have outputs we're spending * @return maximum number of sigops required to validate this transaction's inputs * @see CTransaction::FetchInputs @@ -381,7 +381,7 @@ bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp = NULL /** * Closure representing one script verification - * Note that this stores references to the spending transaction + * Note that this stores references to the spending transaction */ class CScriptCheck { diff --git a/src/version.h b/src/version.h index 9b0f31b35df4c..ff2c1a25e65a2 100644 --- a/src/version.h +++ b/src/version.h @@ -10,7 +10,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 70212; +static const int PROTOCOL_VERSION = 70213; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209;