From 64130da1316ca8830c1075bb3f6c62bae94864cb Mon Sep 17 00:00:00 2001 From: Ittrium Cryptocurrency <37259191+IttriumCore@users.noreply.github.com> Date: Wed, 9 Jan 2019 17:58:33 +0800 Subject: [PATCH] v2.1.0 --- autogen.sh | 4 + configure.ac | 4 +- qa/rpc-tests/wallet.py | 2 +- src/Makefile.am | 1 + src/accumulatormap.cpp | 2 +- src/accumulatormap.h | 1 + src/accumulators.cpp | 6 +- src/activemasternode.cpp | 29 ++----- src/activemasternode.h | 6 +- src/chain.h | 8 +- src/chainparams.cpp | 40 ++++----- src/chainparams.h | 24 +++--- src/checkpoints.cpp | 2 +- src/clientversion.h | 8 +- src/coincontrol.h | 3 +- src/coins.cpp | 3 +- src/init.cpp | 28 ++---- src/ittrium-cli.cpp | 2 +- src/ittrium-tx.cpp | 4 +- src/ittriumd.cpp | 2 +- src/kernel.cpp | 3 +- src/kernel.h | 3 +- src/key.h | 3 +- src/main.cpp | 156 +++++++++++++++++----------------- src/main.h | 2 +- src/masternode-budget.h | 3 +- src/masternode-payments.cpp | 2 +- src/masternode-sync.cpp | 8 +- src/masternode-sync.h | 3 +- src/masternode.cpp | 30 ++++--- src/masternode.h | 2 + src/masternodeconfig.cpp | 21 ++++- src/masternodeconfig.h | 2 +- src/masternodeman.cpp | 14 +-- src/masternodeman.h | 1 + src/merkleblock.cpp | 1 + src/miner.cpp | 17 ++-- src/net.cpp | 4 +- src/net.h | 4 +- src/noui.cpp | 2 +- src/obfuscation-relay.cpp | 1 + src/obfuscation-relay.h | 2 +- src/obfuscation.cpp | 2 +- src/obfuscation.h | 2 +- src/pow.cpp | 3 +- src/qt/forms/optionsdialog.ui | 2 +- src/qt/privacydialog.cpp | 20 ++--- src/rpcblockchain.cpp | 2 +- src/rpcclient.cpp | 2 +- src/rpcdump.cpp | 2 +- src/rpcmasternode-budget.cpp | 4 +- src/rpcmasternode.cpp | 2 +- src/rpcmining.cpp | 2 +- src/rpcmisc.cpp | 3 +- src/rpcnet.cpp | 4 +- src/rpcprotocol.cpp | 2 +- src/rpcrawtransaction.cpp | 2 +- src/rpcserver.cpp | 2 +- src/rpcserver.h | 1 + src/rpcwallet.cpp | 12 +-- src/serialize.h | 3 +- src/spork.cpp | 65 ++++---------- src/spork.h | 44 ++++------ src/swifttx.cpp | 1 + src/swifttx.h | 2 +- src/txdb.cpp | 1 + src/txdb.h | 1 + src/txmempool.cpp | 1 + src/txmempool.h | 3 +- src/uint256.h | 2 +- src/uint512.h | 1 + src/util.cpp | 2 +- src/util.h | 2 +- src/utilstrencodings.cpp | 1 + src/utilstrencodings.h | 2 - src/utiltime.h | 1 + src/version.h | 13 ++- src/wallet.cpp | 58 +++---------- src/wallet_ismine.cpp | 1 + src/walletdb.cpp | 2 +- src/walletdb.h | 1 + 81 files changed, 335 insertions(+), 404 deletions(-) diff --git a/autogen.sh b/autogen.sh index 46e36ff..27417da 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,8 @@ #!/bin/sh +# Copyright (c) 2013-2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + set -e srcdir="$(dirname $0)" cd "$srcdir" diff --git a/configure.ac b/configure.ac index a769a97..8de569b 100755 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 2) -define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_REVISION, 3) +define(_CLIENT_VERSION_MINOR, 1) +define(_CLIENT_VERSION_REVISION, 0) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2018) diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 519b468..2c88b26 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -9,7 +9,7 @@ # a) creates 3 nodes, with an empty chain (no blocks). # b) node0 mines a block # c) node1 mines 32 blocks, so now node 0 has 60001XIT node 1 has 4250XIT node2 has none. -# d) node0 sends 601 XITto node2, in two transactions (301 XIT then 300 XIT. +# d) node0 sends 601 XIT to node2, in two transactions (301 XIT then 300 XIT. # e) node0 mines a block, collects the fee on the second transaction # f) node1 mines 16 blocks, to mature node0's just-mined block # g) check that node0 has 100-21, node2 has 21 diff --git a/src/Makefile.am b/src/Makefile.am index dc48747..00636ab 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -216,6 +216,7 @@ libbitcoin_server_a_SOURCES = \ rpcrawtransaction.cpp \ rpcserver.cpp \ script/sigcache.cpp \ + sporkdb.cpp \ timedata.cpp \ txdb.cpp \ txmempool.cpp \ diff --git a/src/accumulatormap.cpp b/src/accumulatormap.cpp index 7e7fe06..1bc17aa 100644 --- a/src/accumulatormap.cpp +++ b/src/accumulatormap.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2017 The PIVX developers -// Copyright (c) 2018 The Ittrium Core Developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/accumulatormap.h b/src/accumulatormap.h index 7f54232..6cada96 100644 --- a/src/accumulatormap.h +++ b/src/accumulatormap.h @@ -1,4 +1,5 @@ // Copyright (c) 2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef XIT_ACCUMULATORMAP_H diff --git a/src/accumulators.cpp b/src/accumulators.cpp index 52f1885..ca66672 100644 --- a/src/accumulators.cpp +++ b/src/accumulators.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2017 The PIVX developers -// Copyright (c) 2018 The Ittrium Core developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -155,7 +155,7 @@ bool EraseCheckpoints(int nStartHeight, int nEndHeight) //Get checkpoint value for a specific block height bool CalculateAccumulatorCheckpoint(int nHeight, uint256& nCheckpoint) { - if (nHeight <= chainActive.Height() && chainActive[nHeight]->GetBlockHeader().nVersion < Params().Zerocoin_HeaderVersion()) { + if (nHeight < Params().Zerocoin_StartHeight()) { nCheckpoint = 0; return true; } @@ -189,7 +189,7 @@ bool CalculateAccumulatorCheckpoint(int nHeight, uint256& nCheckpoint) } //make sure this block is eligible for accumulation - if (pindex->GetBlockHeader().nVersion < Params().Zerocoin_HeaderVersion()) { + if (pindex->nHeight < Params().Zerocoin_StartHeight()) { pindex = chainActive[pindex->nHeight + 1]; continue; } diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index a7103d5..16acc5a 100755 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2016 The Dash developers -// Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2015-2017 The PIVX developer +// Copyright (c) 2018-2019 The Ittrium developerss // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -69,17 +69,9 @@ void CActiveMasternode::ManageStatus() service = CService(strMasterNodeAddr); } - if (Params().NetworkID() == CBaseChainParams::MAIN) { - if (service.GetPort() != 39993) { - notCapableReason = strprintf("Invalid port: %u - only 39993 is supported on mainnet.", service.GetPort()); - LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason); - return; - } - } else if (service.GetPort() == 39993) { - notCapableReason = strprintf("Invalid port: %u - 39993 is only supported on mainnet.", service.GetPort()); - LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason); + // The service needs the correct default port to work properly + if(!CMasternodeBroadcast::CheckDefaultPort(strMasterNodeAddr, errorMessage, "CActiveMasternode::ManageStatus()")) return; - } LogPrintf("CActiveMasternode::ManageStatus() - Checking inbound connection to '%s'\n", service.ToString()); @@ -268,17 +260,10 @@ bool CActiveMasternode::Register(std::string strService, std::string strKeyMaste } CService service = CService(strService); - if (Params().NetworkID() == CBaseChainParams::MAIN) { - if (service.GetPort() != 39993) { - errorMessage = strprintf("Invalid port %u for masternode %s - only 39993 is supported on mainnet.", service.GetPort(), strService); - LogPrintf("CActiveMasternode::Register() - %s\n", errorMessage); - return false; - } - } else if (service.GetPort() == 39993) { - errorMessage = strprintf("Invalid port %u for masternode %s - 39993 is only supported on mainnet.", service.GetPort(), strService); - LogPrintf("CActiveMasternode::Register() - %s\n", errorMessage); + + // The service needs the correct default port to work properly + if(!CMasternodeBroadcast::CheckDefaultPort(strService, errorMessage, "CActiveMasternode::Register()")) return false; - } addrman.Add(CAddress(service), CNetAddr("127.0.0.1"), 2 * 60 * 60); diff --git a/src/activemasternode.h b/src/activemasternode.h index f48b3f0..97e7cfa 100755 --- a/src/activemasternode.h +++ b/src/activemasternode.h @@ -1,6 +1,6 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2012 The Bitcoin developers -// Copyright (c) 2015-2016 The Dash developers +// Copyright (c) 2014-2016 The Dash developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/chain.h b/src/chain.h index 4890dd2..e22b849 100755 --- a/src/chain.h +++ b/src/chain.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developerss // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -373,6 +374,11 @@ class CBlockIndex nFlags |= BLOCK_STAKE_MODIFIER; } + /** + * Returns true if there are nRequired or more blocks of minVersion or above + * in the last Params().ToCheckBlockUpgradeMajority() blocks, starting at pstart + * and going backwards. + */ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned int nRequired); std::string ToString() const diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 392a55f..901f266 100755 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developerss // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -67,6 +67,7 @@ static Checkpoints::MapCheckpoints mapCheckpoints = (99879, uint256("0x09f07b93863c421d8826ef7eafb1610237f2f817820ac2ab6ee2c1e1793de3d6")) (100439, uint256("0xe733ee2c2139fc2acc545f4c8291c12aa1ef92809648b362384d4df705420222")) (120000, uint256("0xe71bfd9b83553901ff9044c7a7b572de6b5a2f577691603319d6dccbfbf921666")); + //(151259, uint256("0x")); static const Checkpoints::CCheckpointData data = { &mapCheckpoints, @@ -134,6 +135,16 @@ class CMainParams : public CChainParams nModifierUpdateBlock = 1; //***CHECK-->615800*** nMaxMoneyOut = 33000000 * COIN; + /** Height or Time Based Activations **/ + nModifierUpdateBlock = 0; + nZerocoinStartHeight = 151301; + nZerocoinStartTime = 1546486413; // Jan 3, 2019 3:33:33 AM (Happy 10th Birthday Bitcoin!) + nBlockEnforceSerialRange = 151303; //Enforce serial range starting this block + nBlockRecalculateAccumulators = 151304; //Trigger a recalculation of accumulators + nBlockFirstFraudulent = 151302; //First block that bad serials emerged + nBlockLastGoodCheckpoint = 151259; //Last valid accumulator checkpoint + nBlockEnforceInvalidUTXO = 151300; //Start enforcing the invalid UTXO's + /** block.nTime = 1533333333 block.nNonce = 445453 @@ -165,11 +176,11 @@ class CMainParams : public CChainParams assert(hashGenesisBlock == uint256("0x000000fdacddaba54eb66a4c09dc795efbfc75fcd0572c99f489424367bc9ec9")); assert(genesis.hashMerkleRoot == uint256("0xfc052cd7cd34c839bde40a2c9e484ef50c48858667c3d6dd2938b6668479c374")); - vSeeds.push_back(CDNSSeedData("01.ittriumno.de", "01.ittriumno.de")); - vSeeds.push_back(CDNSSeedData("02.ittriumno.de", "02.ittriumno.de")); - vSeeds.push_back(CDNSSeedData("03.ittriumno.de", "03.ittriumno.de")); - vSeeds.push_back(CDNSSeedData("04.ittriumno.de", "04.ittriumno.de")); - vSeeds.push_back(CDNSSeedData("05.ittriumno.de", "05.ittriumno.de")); + vSeeds.push_back(CDNSSeedData("88.99.123.145", "88.99.123.145")); + vSeeds.push_back(CDNSSeedData("02.ittriumno.de", "02.ittriumno.de")); + vSeeds.push_back(CDNSSeedData("03.ittriumno.de", "03.ittriumno.de")); + vSeeds.push_back(CDNSSeedData("04.ittriumno.de", "04.ittriumno.de")); + vSeeds.push_back(CDNSSeedData("05.ittriumno.de", "05.ittriumno.de")); // Ittrium addresses start with 'i' base58Prefixes[PUBKEY_ADDRESS] = std::vector(1, 103); @@ -184,7 +195,7 @@ class CMainParams : public CChainParams // BIP44 coin type is from https://github.com/satoshilabs/slips/blob/master/slip-0044.md base58Prefixes[EXT_COIN_TYPE] = boost::assign::list_of(0x80)(0x00)(0x00)(0xde).convert_to_container >(); - convertSeed6(vFixedSeeds, pnSeed6_main, ARRAYLEN(pnSeed6_main)); + //convertSeed6(vFixedSeeds, pnSeed6_main, ARRAYLEN(pnSeed6_main)); fRequireRPCPassword = true; fMiningRequiresPeers = true; @@ -213,14 +224,9 @@ class CMainParams : public CChainParams nMinZerocoinMintFee = 1 * CENT; //high fee required for zerocoin mints nMintRequiredConfirmations = 20; //the maximum amount of confirmations until accumulated in 19 nRequiredAccumulation = 1; - nDefaultSecurityLevel = 100; //full security level for accumulators + nDefaultSecurityLevel = 42; //full security level for accumulators nZerocoinHeaderVersion = 4; //Block headers must be this version once zerocoin is active nBudget_Fee_Confirmations = 6; // Number of confirmations for the finalization fee - - /** Staking Requirements */ - nStakeMinStartProtocol = 70911; // Starting protocol version (ActiveProtocol()) - nStakeMinConfirmations = 60; // Required number of confirmations - nStakeMinAmount = 5 * COIN; // Minimum required staking amount } const Checkpoints::CCheckpointData& Checkpoints() const @@ -291,7 +297,7 @@ class CTestNetParams : public CMainParams // Testnet ittrium BIP44 coin type is '1' (All coin's testnet default) base58Prefixes[EXT_COIN_TYPE] = boost::assign::list_of(0x80)(0x00)(0x00)(0x01).convert_to_container >(); - convertSeed6(vFixedSeeds, pnSeed6_test, ARRAYLEN(pnSeed6_test)); + //convertSeed6(vFixedSeeds, pnSeed6_test, ARRAYLEN(pnSeed6_test)); fRequireRPCPassword = true; fMiningRequiresPeers = false; @@ -306,10 +312,6 @@ class CTestNetParams : public CMainParams //strObfuscationPoolDummyAddress = ""; nStartMasternodePayments = 150; - /** Staking Requirements */ - nStakeMinStartProtocol = 70910; // Starting protocol version (ActiveProtocol()) - nStakeMinConfirmations = 60; // Required number of confirmations - nStakeMinAmount = 5 * COIN; // Minimum required staking amount } const Checkpoints::CCheckpointData& Checkpoints() const { @@ -464,4 +466,4 @@ bool SelectParamsFromCommandLine() SelectParams(network); return true; -} +} \ No newline at end of file diff --git a/src/chainparams.h b/src/chainparams.h index 8cf34f2..0bca49f 100755 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -1,8 +1,8 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers -// Copyright (c) 2015-2018 The PIVX Core developers -// Copyright (c) 2018 The Ittrium Core developers +// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -61,7 +61,6 @@ class CChainParams /** Used if GenerateBitcoins is called with a negative number of threads */ int DefaultMinerThreads() const { return nMinerThreads; } const CBlock& GenesisBlock() const { return genesis; } - bool RequireRPCPassword() const { return fRequireRPCPassword; } /** Make miner wait to have peers to avoid wasting work */ bool MiningRequiresPeers() const { return fMiningRequiresPeers; } /** Headers first syncing is disabled */ @@ -112,12 +111,12 @@ class CChainParams int ModifierUpgradeBlock() const { return nModifierUpdateBlock; } int LAST_POW_BLOCK() const { return nLastPOWBlock; } int Zerocoin_StartHeight() const { return nZerocoinStartHeight; } + int Zerocoin_Block_EnforceSerialRange() const { return nBlockEnforceSerialRange; } + int Zerocoin_Block_RecalculateAccumulators() const { return nBlockRecalculateAccumulators; } + int Zerocoin_Block_FirstFraudulent() const { return nBlockFirstFraudulent; } + int Zerocoin_Block_LastGoodCheckpoint() const { return nBlockLastGoodCheckpoint; } int Zerocoin_StartTime() const { return nZerocoinStartTime; } - - /** Staking Requirements */ - int Stake_MinProtocol() const { return nStakeMinStartProtocol; } - int Stake_MinConfirmations() const { return nStakeMinConfirmations; } - CAmount Stake_MinAmount() const { return nStakeMinAmount; } + int Block_Enforce_Invalid() const { return nBlockEnforceInvalidUTXO; } protected: CChainParams() {} @@ -171,10 +170,11 @@ class CChainParams int nZerocoinStartHeight; int nZerocoinStartTime; - /** Staking Requirements */ - int nStakeMinStartProtocol; - int nStakeMinConfirmations; - CAmount nStakeMinAmount; + int nBlockEnforceSerialRange; + int nBlockRecalculateAccumulators; + int nBlockFirstFraudulent; + int nBlockLastGoodCheckpoint; + int nBlockEnforceInvalidUTXO; }; /** diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index f483843..7cd5575 100755 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/clientversion.h b/src/clientversion.h index dec4214..e708152 100755 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -15,8 +15,8 @@ //! These need to be macros, as clientversion.cpp's and ittrium*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 2 -#define CLIENT_VERSION_MINOR 0 -#define CLIENT_VERSION_REVISION 3 +#define CLIENT_VERSION_MINOR 1 +#define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 //! Set to true for release, false for prerelease or test build @@ -26,7 +26,7 @@ * Copyright year (2009-this) * Todo: update this when changing our copyright comments in the source */ -#define COPYRIGHT_YEAR 2018 +#define COPYRIGHT_YEAR 2019 #endif //HAVE_CONFIG_H @@ -38,7 +38,7 @@ #define DO_STRINGIZE(X) #X //! Copyright string used in Windows .rc files -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, 2014-" STRINGIZE(COPYRIGHT_YEAR) " The Dash Core Developers, 2015-" STRINGIZE(COPYRIGHT_YEAR) " The PIVX Core Developers, 2017-" STRINGIZE(COPYRIGHT_YEAR) " The Ittrium Core Developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, 2014-" STRINGIZE(COPYRIGHT_YEAR) " The Dash Core Developers, 2015-" STRINGIZE(COPYRIGHT_YEAR) " The PIVX Core Developers, 2018-" STRINGIZE(COPYRIGHT_YEAR) " The Ittrium Core Developers" /** * ittriumd-res.rc includes this file, but it cannot cope with real c++ code. diff --git a/src/coincontrol.h b/src/coincontrol.h index c078d2d..c60f19a 100755 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -1,6 +1,7 @@ // Copyright (c) 2011-2013 The Bitcoin developers // Copyright (c) 2014-2016 The Dash developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/coins.cpp b/src/coins.cpp index 21d43ba..e2ac172 100755 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2012-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/init.cpp b/src/init.cpp index 0dc1c7b..27eb850 100755 --- a/src/init.cpp +++ b/src/init.cpp @@ -1352,32 +1352,20 @@ bool AppInit2(boost::thread_group& threadGroup) // Recalculate money supply for blocks that are impacted by accounting issue after zerocoin activation if (GetBoolArg("-reindexmoneysupply", false)) { - int nZerocoinStartHeight = GetZerocoinStartHeight(); - if (nZerocoinStartHeight != 0) { - if (chainActive.Height() > nZerocoinStartHeight) { - RecalculateZXITMinted(); - RecalculateZXITSpent(); - } + if (chainActive.Height() > Params().Zerocoin_StartHeight()) { + RecalculateZXITMinted(); + RecalculateZXITSpent(); } RecalculateXITSupply(1); } // Force recalculation of accumulators. if (GetBoolArg("-reindexaccumulators", false)) { - int nZerocoinStartHeight = GetZerocoinStartHeight(); - if (nZerocoinStartHeight != 0) { - CBlockIndex* pindex = chainActive[nZerocoinStartHeight]; - while (pindex->nHeight < chainActive.Height()) { - if (!count(listAccCheckpointsNoDB.begin(), listAccCheckpointsNoDB.end(), pindex->nAccumulatorCheckpoint)) - listAccCheckpointsNoDB.emplace_back(pindex->nAccumulatorCheckpoint); - pindex = chainActive.Next(pindex); - } - - // if we have iterated to the end of the blockchain, then checkpoints should be in sync - if (pindex->nHeight + 1 <= chainActive.Height()) - pindex = chainActive[pindex->nHeight + 1]; - else - break; + CBlockIndex* pindex = chainActive[Params().Zerocoin_StartHeight()]; + while (pindex->nHeight < chainActive.Height()) { + if (!count(listAccCheckpointsNoDB.begin(), listAccCheckpointsNoDB.end(), pindex->nAccumulatorCheckpoint)) + listAccCheckpointsNoDB.emplace_back(pindex->nAccumulatorCheckpoint); + pindex = chainActive.Next(pindex); } } diff --git a/src/ittrium-cli.cpp b/src/ittrium-cli.cpp index d12292a..9e4df28 100755 --- a/src/ittrium-cli.cpp +++ b/src/ittrium-cli.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2015 The Bitcoin developers // Copyright (c) 2009-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/ittrium-tx.cpp b/src/ittrium-tx.cpp index 915a199..8932236 100755 --- a/src/ittrium-tx.cpp +++ b/src/ittrium-tx.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/ittriumd.cpp b/src/ittriumd.cpp index fe73a55..681a1bb 100755 --- a/src/ittriumd.cpp +++ b/src/ittriumd.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/kernel.cpp b/src/kernel.cpp index 60f9bef..76cf4b6 100755 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -1,6 +1,7 @@ /* @flow */ // Copyright (c) 2012-2013 The PPCoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/kernel.h b/src/kernel.h index 6d3545f..68757fc 100755 --- a/src/kernel.h +++ b/src/kernel.h @@ -1,5 +1,6 @@ // Copyright (c) 2012-2013 The PPCoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KERNEL_H diff --git a/src/key.h b/src/key.h index ea28785..344ac75 100755 --- a/src/key.h +++ b/src/key.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/main.cpp b/src/main.cpp index b0e7fc5..a41cb8f 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -985,20 +985,9 @@ bool MoneyRange(CAmount nValueOut) return nValueOut >= 0 && nValueOut <= Params().MaxMoneyOut(); } -// TODO (ZC): Add this back when we have a hardcoded start height. - -int nZerocoinStartHeight = 0; int GetZerocoinStartHeight() { - if (nZerocoinStartHeight) - return nZerocoinStartHeight; - for (int i = 1; i < chainActive.Height(); i++) { - if (chainActive[i]->nVersion < Params().Zerocoin_HeaderVersion()) - continue; - nZerocoinStartHeight = i; - break; - } - return nZerocoinStartHeight; + return Params().Zerocoin_StartHeight(); } void FindMints(vector vMintsToFind, vector& vMintsToUpdate, vector& vMissingMints, bool fExtendedSearch) @@ -1284,9 +1273,6 @@ std::list ZerocoinSpendListFromBlock(const CBlock bool CheckZerocoinMint(const uint256& txHash, const CTxOut& txout, CValidationState& state, bool fCheckOnly) { - if(!fCheckOnly && GetAdjustedTime() < GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) - return state.DoS(100, error("CheckZerocoinMint(): Zerocoin transactions are not allowed yet")); - PublicCoin pubCoin(Params().Zerocoin_Params()); if(!TxOutToPublicCoin(txout, pubCoin, state)) return state.DoS(100, error("CheckZerocoinMint(): TxOutToPublicCoin() failed")); @@ -1309,6 +1295,26 @@ CoinSpend TxInToZerocoinSpend(const CTxIn& txin) CDataStream serializedCoinSpend(dataTxIn, SER_NETWORK, PROTOCOL_VERSION); return CoinSpend(Params().Zerocoin_Params(), serializedCoinSpend); } +//Check a zerocoinspend considering external context such as blockchain data, height, etc. +bool ContextualCheckCoinSpend(const CoinSpend& spend, CBlockIndex* pindex, const uint256& txid) +{ + // Make sure that the serial number is in valid range + if (pindex->nHeight >= Params().Zerocoin_Block_EnforceSerialRange()) { + if (!spend.HasValidSerial(Params().Zerocoin_Params())) + return error("%s : txid=%s in block %d contains invalid serial %s\n", __func__, txid.GetHex(), + pindex->nHeight, spend.getCoinSerialNumber()); + } + + //Is the serial already in the blockchain? + int nHeightTxSpend = 0; + if (IsSerialInBlockchain(spend.getCoinSerialNumber(), nHeightTxSpend)) { + if(!fVerifyingBlocks || (fVerifyingBlocks && pindex->nHeight > nHeightTxSpend)) + return error("%s : zXIT with serial %s is already in the block %d\n", __func__, + spend.getCoinSerialNumber().GetHex(), nHeightTxSpend); + } + + return true; +} bool IsZerocoinSpendUnknown(CoinSpend coinSpend, uint256 hashTx, CValidationState& state) { @@ -1324,9 +1330,6 @@ bool IsZerocoinSpendUnknown(CoinSpend coinSpend, uint256 hashTx, CValidationStat bool CheckZerocoinSpend(const CTransaction tx, bool fVerifySignature, CValidationState& state) { - if(GetAdjustedTime() < GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) - return state.DoS(100, error("CheckZerocoinSpend(): Zerocoin transactions are not allowed yet")); - //max needed non-mint outputs should be 2 - one for redemption address and a possible 2nd for change if (tx.vout.size() > 2) { int outs = 0; @@ -1427,7 +1430,7 @@ bool CheckTransaction(const CTransaction& tx, bool fZerocoinActive, bool fReject // Size limits unsigned int nMaxSize = MAX_BLOCK_SIZE_LEGACY; - if(GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) + if(chainActive.Height() >= Params().Zerocoin_StartHeight()) nMaxSize = MAX_ZEROCOIN_TX_SIZE; if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) > nMaxSize) @@ -1574,10 +1577,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa *pfMissingInputs = false; //Temporarily disable zerocoin for maintenance - if (GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()) + if (GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()) return state.DoS(10, error("AcceptToMemoryPool : Zerocoin transactions are temporarily disabled for maintenance"), REJECT_INVALID, "bad-tx"); - if (!CheckTransaction(tx, GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN), true, state)) + if (!CheckTransaction(tx, chainActive.Height() >= Params().Zerocoin_StartHeight(), true, state)) return state.DoS(100, error("AcceptToMemoryPool: : CheckTransaction failed"), REJECT_INVALID, "bad-tx"); // Coinbase is only valid in a block, not as a loose transaction @@ -1703,7 +1706,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa // merely non-standard transaction. if (!tx.IsZerocoinSpend()) { unsigned int nSigOps = GetLegacySigOpCount(tx); - unsigned int nMaxSigOps = GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN) ? MAX_TX_SIGOPS_CURRENT : MAX_TX_SIGOPS_LEGACY; + unsigned int nMaxSigOps = chainActive.Height() >= Params().Zerocoin_StartHeight() ? MAX_BLOCK_SIGOPS_CURRENT : MAX_BLOCK_SIGOPS_LEGACY; nSigOps += GetP2SHSigOpCount(tx, view); if(nSigOps > nMaxSigOps) return state.DoS(0, @@ -1803,7 +1806,7 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransact if (pfMissingInputs) *pfMissingInputs = false; - if (!CheckTransaction(tx, GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN), true, state)) + if (!CheckTransaction(tx, chainActive.Height() >= Params().Zerocoin_StartHeight(), true, state)) return error("AcceptableInputs: : CheckTransaction failed"); // Coinbase is only valid in a block, not as a loose transaction @@ -1899,7 +1902,7 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransact // MAX_BLOCK_SIGOPS; we still consider this an invalid rather than // merely non-standard transaction. unsigned int nSigOps = GetLegacySigOpCount(tx); - unsigned int nMaxSigOps = GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN) ? MAX_TX_SIGOPS_CURRENT : MAX_TX_SIGOPS_LEGACY; + unsigned int nMaxSigOps = chainActive.Height() >= Params().Zerocoin_StartHeight() ? MAX_BLOCK_SIGOPS_CURRENT : MAX_BLOCK_SIGOPS_LEGACY; nSigOps += GetP2SHSigOpCount(tx, view); if (nSigOps > nMaxSigOps) return state.DoS(0, @@ -2626,9 +2629,7 @@ void ThreadScriptCheck() void RecalculateZXITMinted() { - int nZerocoinStartHeight = GetZerocoinStartHeight(); - if (nZerocoinStartHeight == 0) return; - CBlockIndex *pindex = chainActive[nZerocoinStartHeight]; +CBlockIndex *pindex = chainActive[Params().Zerocoin_StartHeight()]; int nHeightEnd = chainActive.Height(); while (true) { if (pindex->nHeight % 1000 == 0) @@ -2655,9 +2656,7 @@ void RecalculateZXITMinted() void RecalculateZXITSpent() { - int nZerocoinStartHeight = GetZerocoinStartHeight(); - if (nZerocoinStartHeight == 0) return; - CBlockIndex* pindex = chainActive[nZerocoinStartHeight]; +CBlockIndex *pindex = chainActive[Params().Zerocoin_StartHeight()]; while (true) { if (pindex->nHeight % 1000 == 0) LogPrintf("%s : block %d...\n", __func__, pindex->nHeight); @@ -2698,6 +2697,8 @@ bool RecalculateXITSupply(int nHeightStart) CBlockIndex* pindex = chainActive[nHeightStart]; CAmount nSupplyPrev = pindex->pprev->nMoneySupply; + if (nHeightStart == Params().Zerocoin_StartHeight()) + //nSupplyPrev = CAmount(3050000000000000); AAA333 while (true) { if (pindex->nHeight % 1000 == 0) @@ -2749,13 +2750,14 @@ bool RecalculateXITSupply(int nHeightStart) bool ReindexAccumulators(list& listMissingCheckpoints, string& strError) { - int nZerocoinStart = GetZerocoinStartHeight(); - if (nZerocoinStart == 0) return false; // Ittrium: recalculate Accumulator Checkpoints that failed to database properly - if (!listMissingCheckpoints.empty() && chainActive.Height() >= nZerocoinStart) { +if (!listMissingCheckpoints.empty() && chainActive.Height() >= Params().Zerocoin_StartHeight()) { //uiInterface.InitMessage(_("Calculating missing accumulators...")); LogPrintf("%s : finding missing checkpoints\n", __func__); + //search the chain to see when zerocoin started + int nZerocoinStart = Params().Zerocoin_StartHeight(); + // find each checkpoint that is missing CBlockIndex* pindex = chainActive[nZerocoinStart]; while (!listMissingCheckpoints.empty()) { @@ -2848,7 +2850,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // two in the chain that violate it. This prevents exploiting the issue against nodes in their // initial block download. bool fEnforceBIP30 = (!pindex->phashBlock) || // Enforce on CreateNewBlock invocations which don't have a hash. - !((pindex->nHeight == 120001 && pindex->GetBlockHash() == uint256("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) || + !((pindex->nHeight == 91842 && pindex->GetBlockHash() == uint256("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) || (pindex->nHeight == 91880 && pindex->GetBlockHash() == uint256("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"))); if (fEnforceBIP30) { BOOST_FOREACH (const CTransaction& tx, block.vtx) { @@ -2884,7 +2886,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin blockundo.vtxundo.reserve(block.vtx.size() - 1); CAmount nValueOut = 0; CAmount nValueIn = 0; - unsigned int nMaxBlockSigOps = block.nTime > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN) ? MAX_BLOCK_SIGOPS_CURRENT : MAX_BLOCK_SIGOPS_LEGACY; + unsigned int nMaxBlockSigOps = chainActive.Height() >= Params().Zerocoin_StartHeight() ? MAX_BLOCK_SIGOPS_CURRENT : MAX_BLOCK_SIGOPS_LEGACY; for (unsigned int i = 0; i < block.vtx.size(); i++) { const CTransaction& tx = block.vtx[i]; @@ -2895,7 +2897,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin REJECT_INVALID, "bad-blk-sigops"); //Temporarily disable zerocoin transactions for maintenance - if (block.nTime > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && !IsInitialBlockDownload() && tx.ContainsZerocoins()) { + if (block.nTime > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE) && !IsInitialBlockDownload() && tx.ContainsZerocoins()) { return state.DoS(100, error("ConnectBlock() : zerocoin transactions are currently in maintenance mode")); } if (tx.IsZerocoinSpend()) { @@ -3035,10 +3037,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin REJECT_INVALID, "bad-cb-amount"); } - int nZerocoinStart = GetZerocoinStartHeight(); - if (nZerocoinStart != 0) { - // zerocoin accumulator: if a new accumulator checkpoint was generated, check that it is the correct value - if (!fVerifyingBlocks && pindex->nHeight >= nZerocoinStart && pindex->nHeight % 10 == 0) { + // zerocoin accumulator: if a new accumulator checkpoint was generated, check that it is the correct value + if (!fVerifyingBlocks && pindex->nHeight >= Params().Zerocoin_StartHeight() && pindex->nHeight % 10 == 0) { uint256 nCheckpointCalculated = 0; if (!CalculateAccumulatorCheckpoint(pindex->nHeight, nCheckpointCalculated)) { @@ -3052,7 +3052,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } else if (!fVerifyingBlocks) { if (block.nAccumulatorCheckpoint != pindex->pprev->nAccumulatorCheckpoint) return state.DoS(100, error("ConnectBlock() : new accumulator checkpoint generated on a block that is not multiple of 10")); - } + } if (!control.Wait()) @@ -3898,14 +3898,14 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f return state.DoS(50, error("CheckBlockHeader() : proof of work failed"), REJECT_INVALID, "high-hash"); - // Version 4 header must be used when SPORK_20_ENABLE_ZEROCOIN is activated. And never before. - if (block.GetBlockTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) { - if (block.nVersion < Params().Zerocoin_HeaderVersion()) - return state.DoS(50, error("CheckBlockHeader() : block version must be above 4 after SPORK_21"), + // Version 4 header must be used after Params().Zerocoin_StartHeight(). And never before. + if (chainActive.Height() >= Params().Zerocoin_StartHeight()) { + if(block.nVersion < Params().Zerocoin_HeaderVersion()) + return state.DoS(50, error("CheckBlockHeader() : block version must be above 4 after ZerocoinStartHeight"), REJECT_INVALID, "block-version"); } else { if (block.nVersion >= Params().Zerocoin_HeaderVersion()) - return state.DoS(50, error("CheckBlockHeader() : block version must be below 4 before SPORK_21"), + return state.DoS(50, error("CheckBlockHeader() : block version must be below 4 before ZerocoinStartHeight"), REJECT_INVALID, "block-version"); } @@ -3949,7 +3949,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo // because we receive the wrong transactions for it. // Size limits - unsigned int nMaxBlockSize = GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN) ? MAX_BLOCK_SIZE_CURRENT : MAX_BLOCK_SIZE_LEGACY; + unsigned int nMaxBlockSize = chainActive.Height() >= Params().Zerocoin_StartHeight() ? MAX_BLOCK_SIZE_CURRENT : MAX_BLOCK_SIZE_LEGACY; if (block.vtx.empty() || block.vtx.size() > nMaxBlockSize || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > nMaxBlockSize) return state.DoS(100, error("CheckBlock() : size limits failed"), REJECT_INVALID, "bad-blk-length"); @@ -3999,9 +3999,8 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo // masternode payments / budgets CBlockIndex* pindexPrev = chainActive.Tip(); - //int nHeight = 0; //v2.0.3/// + int nHeight = 0; if (pindexPrev != NULL) { - int nHeight = 0; if (pindexPrev->GetBlockHash() == block.hashPrevBlock) { nHeight = pindexPrev->nHeight + 1; } else { //out of order @@ -4010,6 +4009,13 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo nHeight = (*mi).second->nHeight + 1; } + // Version 4 header must be used after Params().Zerocoin_StartHeight(). And never before. + if (nHeight > Params().Zerocoin_StartHeight()) { + if(block.nVersion < Params().Zerocoin_HeaderVersion()) + return state.DoS(50, error("CheckBlockHeader() : block version must be above 4 after ZerocoinStartHeight"), + REJECT_INVALID, "block-version"); + } + // It is entierly possible that we don't have enough data and this could fail // (i.e. the block could indeed be valid). Store the block for later consideration // but issue an initial reject message. @@ -4030,7 +4036,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo // ------------------------------------------- // Check transactions - bool fZerocoinActive = block.nTime > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN); + bool fZerocoinActive = chainActive.Height() >= Params().Zerocoin_StartHeight(); vector vBlockSerials; for (const CTransaction& tx : block.vtx) { if (!CheckTransaction(tx, fZerocoinActive, true, state)) @@ -5516,14 +5522,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Ittrium: We use certain sporks during IBD, so check to see if they are // available. If not, ask the first peer connected for them. - if (!pSporkDB->SporkExists(SPORK_14_NEW_PROTOCOL_ENFORCEMENT) && - !pSporkDB->SporkExists(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) && - !pSporkDB->SporkExists(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && - !pSporkDB->SporkExists(SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3) && - !pSporkDB->SporkExists(SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4) && - !pSporkDB->SporkExists(SPORK_19_NEW_PROTOCOL_DYNAMIC) && - !pSporkDB->SporkExists(SPORK_20_ENABLE_ZEROCOIN)) { - LogPrintf("Required sporks not found, asking peer to send them\n"); + bool fMissingSporks = !pSporkDB->SporkExists(SPORK_14_NEW_PROTOCOL_ENFORCEMENT) && + !pSporkDB->SporkExists(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) && + !pSporkDB->SporkExists(SPORK_16_ZEROCOIN_MAINTENANCE_MODE); + + if (fMissingSporks || !fRequestedSporksIDB){ + LogPrintf("asking peer for sporks\n"); pfrom->PushMessage("getsporks"); fRequestedSporksIDB = true; } @@ -5581,11 +5585,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (fListen && !IsInitialBlockDownload()) { CAddress addr = GetLocalAddress(&pfrom->addr); if (addr.IsRoutable()) { -// LogPrintf("ProcessMessages: advertizing address %s\n", addr.ToString()); + LogPrintf("ProcessMessages: advertizing address %s\n", addr.ToString()); pfrom->PushAddress(addr); } else if (IsPeerAddrLocalGood(pfrom)) { addr.SetIP(pfrom->addrLocal); -// LogPrintf("ProcessMessages: advertizing address %s\n", addr.ToString()); + LogPrintf("ProcessMessages: advertizing address %s\n", addr.ToString()); pfrom->PushAddress(addr); } } @@ -6329,26 +6333,24 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } // Note: whenever a protocol update is needed toggle between both implementations (comment out the formerly active one) -// so we can leave the existing clients untouched (old SPORK will stay on so they don't see even older clients). +// so we can leave the existing clients untouched (old SPORK will stay on so they don't see even older clients). // Those old clients won't react to the changes of the other (new) SPORK because at the time of their implementation -// - +// it was the one which was commented out int ActiveProtocol() { - if (IsSporkActive(SPORK_19_NEW_PROTOCOL_DYNAMIC)) - return GetSporkValue(SPORK_19_NEW_PROTOCOL_DYNAMIC); - return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT18; - - if (IsSporkActive(SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4)) - return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT18; - - if (IsSporkActive(SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3)) - return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT17; - - if (IsSporkActive(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2)) - return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT15; - // Return the current protocol version if no spork is active. + // SPORK_14 was used for 70910. Leave it 'ON' so they don't see > 70910 nodes. They won't react to SPORK_15 + // messages because it's not in their code + +/* if (IsSporkActive(SPORK_14_NEW_PROTOCOL_ENFORCEMENT)) + return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT; +*/ + + // SPORK_15 is used for 70911. Nodes < 70911 don't see it and still get their protocol version via SPORK_14 and their + // own ModifierUpgradeBlock() + + if (IsSporkActive(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2)) + return MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT; return MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT; } diff --git a/src/main.h b/src/main.h index c79bdfb..61a206c 100755 --- a/src/main.h +++ b/src/main.h @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/masternode-budget.h b/src/masternode-budget.h index 8b03b6f..b2cf60f 100755 --- a/src/masternode-budget.h +++ b/src/masternode-budget.h @@ -1,7 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers - +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index ad0836e..fbfbbb3 100755 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index c3e1030..0da2778 100755 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -53,7 +53,7 @@ bool CMasternodeSync::IsBlockchainSynced() if (pindex == NULL) return false; - if ((pindex->nTime + 60 * 60) < GetTime() && Params().NetworkID() != CBaseChainParams::TESTNET) + if (pindex->nTime + 60 * 60 < GetTime()) return false; fBlockchainSynced = true; @@ -285,13 +285,11 @@ void CMasternodeSync::Process() //set to synced if (RequestedMasternodeAssets == MASTERNODE_SYNC_SPORKS) { - if (RequestedMasternodeAttempt >= 2) GetNextAsset(); - if (pnode->HasFulfilledRequest("getspork")) continue; pnode->FulfilledRequest("getspork"); pnode->PushMessage("getsporks"); //get current network sporks - //if (RequestedMasternodeAttempt >= 2) GetNextAsset(); //v2.0.3// + if (RequestedMasternodeAttempt >= 2) GetNextAsset(); RequestedMasternodeAttempt++; return; diff --git a/src/masternode-sync.h b/src/masternode-sync.h index bf40890..b28fbb6 100755 --- a/src/masternode-sync.h +++ b/src/masternode-sync.h @@ -1,7 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers - +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/masternode.cpp b/src/masternode.cpp index 602aadb..7faf2fb 100755 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -413,19 +413,9 @@ bool CMasternodeBroadcast::Create(std::string strService, std::string strKeyMast return false; } - CService service = CService(strService); - int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort(); - if (Params().NetworkID() == CBaseChainParams::MAIN) { - if (service.GetPort() != mainnetDefaultPort) { - strErrorRet = strprintf("Invalid port %u for masternode %s, only %d is supported on mainnet.", service.GetPort(), strService, mainnetDefaultPort); - LogPrint("masternode","CMasternodeBroadcast::Create -- %s\n", strErrorRet); - return false; - } - } else if (service.GetPort() == mainnetDefaultPort) { - strErrorRet = strprintf("Invalid port %u for masternode %s, %d is the only supported on mainnet.", service.GetPort(), strService, mainnetDefaultPort); - LogPrint("masternode","CMasternodeBroadcast::Create -- %s\n", strErrorRet); + // The service needs the correct default port to work properly + if(!CheckDefaultPort(strService, strErrorRet, "CMasternodeBroadcast::Create")) return false; - } return Create(txin, CService(strService), keyCollateralAddressNew, pubKeyCollateralAddressNew, keyMasternodeNew, pubKeyMasternodeNew, strErrorRet, mnbRet); } @@ -439,7 +429,6 @@ bool CMasternodeBroadcast::Create(CTxIn txin, CService service, CKey keyCollater CBitcoinAddress(pubKeyCollateralAddressNew.GetID()).ToString(), pubKeyMasternodeNew.GetID().ToString()); - CMasternodePing mnp(txin); if (!mnp.Sign(keyMasternodeNew, pubKeyMasternodeNew)) { strErrorRet = strprintf("Failed to sign ping, masternode=%s", txin.prevout.hash.ToString()); @@ -468,6 +457,21 @@ bool CMasternodeBroadcast::Create(CTxIn txin, CService service, CKey keyCollater return true; } +bool CMasternodeBroadcast::CheckDefaultPort(std::string strService, std::string& strErrorRet, std::string strContext) +{ + CService service = CService(strService); + int nDefaultPort = Params().GetDefaultPort(); + + if (service.GetPort() != nDefaultPort) { + strErrorRet = strprintf("Invalid port %u for masternode %s, only %d is supported on %s-net.", + service.GetPort(), strService, nDefaultPort, Params().NetworkIDString()); + LogPrint("masternode", "%s - %s\n", strContext, strErrorRet); + return false; + } + + return true; +} + bool CMasternodeBroadcast::CheckAndUpdate(int& nDos) { // make sure signature isn't in the future (past is OK) diff --git a/src/masternode.h b/src/masternode.h index f885f25..aad7f0f 100755 --- a/src/masternode.h +++ b/src/masternode.h @@ -1,5 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -328,6 +329,7 @@ class CMasternodeBroadcast : public CMasternode /// Create Masternode broadcast, needs to be relayed manually after that static bool Create(CTxIn vin, CService service, CKey keyCollateralAddressNew, CPubKey pubKeyCollateralAddressNew, CKey keyMasternodeNew, CPubKey pubKeyMasternodeNew, std::string& strErrorRet, CMasternodeBroadcast& mnbRet); static bool Create(std::string strService, std::string strKey, std::string strTxHash, std::string strOutputIndex, std::string& strErrorRet, CMasternodeBroadcast& mnbRet, bool fOffline = false); + static bool CheckDefaultPort(std::string strService, std::string& strErrorRet, std::string strContext); }; #endif diff --git a/src/masternodeconfig.cpp b/src/masternodeconfig.cpp index 68eb5a1..fea0074 100755 --- a/src/masternodeconfig.cpp +++ b/src/masternodeconfig.cpp @@ -1,10 +1,12 @@ // Copyright (c) 2014-2015 The Dash developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. // clang-format off #include "net.h" +#include "netbase.h" #include "masternodeconfig.h" #include "util.h" #include "ui_interface.h" @@ -60,15 +62,26 @@ bool CMasternodeConfig::read(std::string& strErr) } } + int port = 0; + std::string hostname = ""; + SplitHostPort(ip, port, hostname); + if(port == 0 || hostname == "") { + strErr = _("Failed to parse host:port string") + "\n"+ + strprintf(_("Line: %d"), linenumber) + "\n\"" + line + "\""; + streamConfig.close(); + return false; + } + if (Params().NetworkID() == CBaseChainParams::MAIN) { - if (CService(ip).GetPort() != 39993) { - strErr = _("Invalid port detected in masternode.conf") + "\n" + + if (port != 39993) { + strErr = _("Invalid port detected in masternode.conf") + "\n" + + strprintf(_("Port: %d"), port) + "\n" + strprintf(_("Line: %d"), linenumber) + "\n\"" + line + "\"" + "\n" + _("(must be 39993 for mainnet)"); streamConfig.close(); return false; } - } else if (CService(ip).GetPort() == 39993) { + } else if (port == 39993) { strErr = _("Invalid port detected in masternode.conf") + "\n" + strprintf(_("Line: %d"), linenumber) + "\n\"" + line + "\"" + "\n" + _("(39993 could be used only on mainnet)"); diff --git a/src/masternodeconfig.h b/src/masternodeconfig.h index 63f7ddd..5b75962 100755 --- a/src/masternodeconfig.h +++ b/src/masternodeconfig.h @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 3ecf6b1..cfd959c 100755 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -14,6 +14,8 @@ #include #include +#define MN_WINNER_MINIMUM_AGE 8000 // Age in seconds. This should be > MASTERNODE_REMOVAL_SECONDS to avoid misconfigured new nodes in the list. + /** Masternode manager */ CMasternodeMan mnodeman; @@ -349,10 +351,10 @@ void CMasternodeMan::Clear() int CMasternodeMan::stable_size () { - int nStable_size = 0; - int nMinProtocol = ActiveProtocol(); - int64_t nMasternode_Min_Age = GetSporkValue(SPORK_16_MN_WINNER_MINIMUM_AGE); - int64_t nMasternode_Age = 0; + int nStable_size = 0; + int nMinProtocol = ActiveProtocol(); + int64_t nMasternode_Min_Age = MN_WINNER_MINIMUM_AGE; + int64_t nMasternode_Age = 0; BOOST_FOREACH (CMasternode& mn, vMasternodes) { if (mn.protocolVersion < nMinProtocol) { @@ -593,7 +595,7 @@ CMasternode* CMasternodeMan::GetCurrentMasterNode(int mod, int64_t nBlockHeight, int CMasternodeMan::GetMasternodeRank(const CTxIn& vin, int64_t nBlockHeight, int minProtocol, bool fOnlyActive) { std::vector > vecMasternodeScores; - int64_t nMasternode_Min_Age = GetSporkValue(SPORK_16_MN_WINNER_MINIMUM_AGE); + int64_t nMasternode_Min_Age = MN_WINNER_MINIMUM_AGE; int64_t nMasternode_Age = 0; //make sure we know about this block diff --git a/src/masternodeman.h b/src/masternodeman.h index a836c8c..582adba 100755 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -1,5 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/merkleblock.cpp b/src/merkleblock.cpp index 04ec867..b1529f8 100755 --- a/src/merkleblock.cpp +++ b/src/merkleblock.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/miner.cpp b/src/miner.cpp index 98c3f2e..df04da9 100755 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developerss // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -109,7 +109,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, pblock->nVersion = GetArg("-blockversion", pblock->nVersion); // Make sure to create the correct block version after zerocoin is enabled - bool fZerocoinActive = GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN); + bool fZerocoinActive = chainActive.Height() >= Params().Zerocoin_StartHeight(); if (fZerocoinActive) pblock->nVersion = 4; else @@ -129,7 +129,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, static int64_t nLastCoinStakeSearchTime = GetAdjustedTime(); // only initialized at startup if (fProofOfStake) { - //std::cout << "fProofOfStake " << chainActive.Tip()->nHeight << std::endl; boost::this_thread::interruption_point(); pblock->nTime = GetAdjustedTime(); CBlockIndex* pindexPrev = chainActive.Tip(); @@ -156,7 +155,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, // Largest block you're willing to create: unsigned int nBlockMaxSize = GetArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE); // Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity: - unsigned int nBlockMaxSizeNetwork = pblock->nTime > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN) ? MAX_BLOCK_SIZE_CURRENT : MAX_BLOCK_SIZE_LEGACY; + unsigned int nBlockMaxSizeNetwork = chainActive.Height() >= Params().Zerocoin_StartHeight() ? MAX_BLOCK_SIZE_CURRENT : MAX_BLOCK_SIZE_LEGACY; nBlockMaxSize = std::max((unsigned int)1000, std::min((nBlockMaxSizeNetwork - 1000), nBlockMaxSize)); // How much of the block should be dedicated to high-priority transactions, @@ -193,7 +192,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, if (tx.IsCoinBase() || tx.IsCoinStake() || !IsFinalTx(tx, nHeight)){ continue; } - if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()){ + if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE) && tx.ContainsZerocoins()){ continue; } @@ -287,7 +286,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, continue; // Legacy limits on sigOps: - unsigned int nMaxBlockSigOps = GetAdjustedTime() > GetSporkValue(SPORK_20_ENABLE_ZEROCOIN) ? MAX_BLOCK_SIGOPS_CURRENT : MAX_BLOCK_SIGOPS_LEGACY; + unsigned int nMaxBlockSigOps = chainActive.Height() >= Params().Zerocoin_StartHeight() ? MAX_BLOCK_SIGOPS_CURRENT : MAX_BLOCK_SIGOPS_LEGACY; unsigned int nTxSigOps = GetLegacySigOpCount(tx); if (nBlockSigOps + nTxSigOps >= nMaxBlockSigOps) continue; @@ -401,11 +400,13 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet, // Compute final coinbase transaction. + pblock->vtx[0].vin[0].scriptSig = CScript() << nHeight << OP_0; if (!fProofOfStake) { pblock->vtx[0] = txNew; pblocktemplate->vTxFees[0] = -nFees; } - pblock->vtx[0].vin[0].scriptSig = CScript() << nHeight << OP_0; + + //pblock->vtx[0].vin[0].scriptSig = CScript() << nHeight << OP_0; // Fill in header pblock->hashPrevBlock = pindexPrev->GetBlockHash(); @@ -531,7 +532,7 @@ void BitcoinMiner(CWallet* pwallet, bool fProofOfStake) continue; } - while (chainActive.Tip()->nTime < 1533333333 || vNodes.empty() || pwallet->IsLocked() || !fMintableCoins || nReserveBalance >= pwallet->GetBalance() || !masternodeSync.IsSynced()) { + while (chainActive.Tip()->nTime < 1533333333 || vNodes.empty() || pwallet->IsLocked() || !fMintableCoins || nReserveBalance >= pwallet->GetBalance() /*|| !masternodeSync.IsSynced()*/) { nLastCoinStakeSearchInterval = 0; MilliSleep(5000); if (!fGenerateBitcoins && !fProofOfStake) diff --git a/src/net.cpp b/src/net.cpp index b9b79ff..12f9ace 100755 --- a/src/net.cpp +++ b/src/net.cpp @@ -1,8 +1,8 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers -// Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/net.h b/src/net.h index 488490f..d5446d3 100755 --- a/src/net.h +++ b/src/net.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/noui.cpp b/src/noui.cpp index d0865ab..a38e653 100755 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/obfuscation-relay.cpp b/src/obfuscation-relay.cpp index e020d81..481cf41 100755 --- a/src/obfuscation-relay.cpp +++ b/src/obfuscation-relay.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/obfuscation-relay.h b/src/obfuscation-relay.h index cce22ec..4b15546 100755 --- a/src/obfuscation-relay.h +++ b/src/obfuscation-relay.h @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/obfuscation.cpp b/src/obfuscation.cpp index 64a65da..c7ffdc7 100755 --- a/src/obfuscation.cpp +++ b/src/obfuscation.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/obfuscation.h b/src/obfuscation.h index 7af6a79..f91d9ef 100755 --- a/src/obfuscation.h +++ b/src/obfuscation.h @@ -1,6 +1,6 @@ // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/pow.cpp b/src/pow.cpp index 7c69de7..ebca428 100755 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 1e9f88c..b30db28 100755 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -480,7 +480,7 @@ Language missing or translation incomplete? Help contributing translations here: -https://www.transifex.com/ittrium-project/ittrium-project-translations +https://www.transifex.com/IttriumCore/IttriumCore-translations true diff --git a/src/qt/privacydialog.cpp b/src/qt/privacydialog.cpp index 2689358..f965946 100644 --- a/src/qt/privacydialog.cpp +++ b/src/qt/privacydialog.cpp @@ -104,7 +104,7 @@ PrivacyDialog::PrivacyDialog(QWidget* parent) : QDialog(parent), ui->dummyHideWidget->hide(); // Dummy widget with elements to hide //temporary disable for maintenance - if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) { + if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) { ui->pushButtonMintzXIT->setEnabled(false); ui->pushButtonMintzXIT->setToolTip(tr("zXIT is currently disabled due to maintenance.")); @@ -157,13 +157,10 @@ void PrivacyDialog::on_pushButtonMintzXIT_clicked() if (!walletModel || !walletModel->getOptionsModel()) return; - if (GetAdjustedTime() < GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) { - QMessageBox::information(this, tr("Mint Zerocoin"), tr("Zerocoin functionality is not enabled on the Ittrium network yet."), QMessageBox::Ok, QMessageBox::Ok); - return; - } - - if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) { - QMessageBox::information(this, tr("Mint Zerocoin"), tr("zXIT is currently undergoing maintenance."), QMessageBox::Ok, QMessageBox::Ok); + if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) { + QMessageBox::information(this, tr("Mint Zerocoin"), + tr("zXIT is currently undergoing maintenance."), QMessageBox::Ok, + QMessageBox::Ok); return; } @@ -273,12 +270,7 @@ void PrivacyDialog::on_pushButtonSpendzXIT_clicked() if (!walletModel || !walletModel->getOptionsModel() || !pwalletMain) return; - if (GetAdjustedTime() < GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) { - QMessageBox::information(this, tr("Spend Zerocoin"), tr("Zerocoin functionality is not enabled on the Ittrium network yet."), QMessageBox::Ok, QMessageBox::Ok); - return; - } - - if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) { + if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) { QMessageBox::information(this, tr("Mint Zerocoin"), tr("zXIT is currently undergoing maintenance."), QMessageBox::Ok, QMessageBox::Ok); return; diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5b6a88a..2bddd3f 100755 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 77a2655..956b21b 100755 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index c866a62..fa8228a 100755 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcmasternode-budget.cpp b/src/rpcmasternode-budget.cpp index bfa1ceb..7bb8bb4 100755 --- a/src/rpcmasternode-budget.cpp +++ b/src/rpcmasternode-budget.cpp @@ -1,6 +1,6 @@ -// Copyright (c) 2014-2015 The Dash Developers +// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcmasternode.cpp b/src/rpcmasternode.cpp index f928f75..e48ff09 100755 --- a/src/rpcmasternode.cpp +++ b/src/rpcmasternode.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index b8fbb37..416d266 100755 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 7d26e78..81c665f 100755 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -281,7 +281,6 @@ UniValue spork(const UniValue& params, bool fHelp) //broadcast new spork if (sporkManager.UpdateSpork(nSporkID, nValue)) { - ExecuteSpork(nSporkID, nValue); return "success"; } else { return "failure"; diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 53cc75c..1e1724e 100755 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -409,7 +409,7 @@ UniValue getnetworkinfo(const UniValue& params, bool fHelp) UniValue setban(const UniValue& params, bool fHelp) { - string strCommand; + string strCommand; if (params.size() >= 2) strCommand = params[1].get_str(); if (fHelp || params.size() < 2 || diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 36cefbc..20df6ab 100755 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index b705987..4c02891 100755 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 252ee30..8597bb5 100755 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcserver.h b/src/rpcserver.h index caceee8..ad1f954 100755 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -1,6 +1,7 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 8ecf65a..0e09c43 100755 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -2421,10 +2421,7 @@ UniValue mintzerocoin(const UniValue& params, bool fHelp) int64_t nTime = GetTimeMillis(); - if (GetAdjustedTime() < GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) - throw JSONRPCError(RPC_WALLET_ERROR, "Error: Zerocoin functionality is not enabled on the Ittrium network yet."); - - if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) + if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) throw JSONRPCError(RPC_WALLET_ERROR, "zXIT is currently disabled due to maintenance."); if (pwalletMain->IsLocked()) @@ -2470,10 +2467,7 @@ UniValue spendzerocoin(const UniValue& params, bool fHelp) "an address is required" + HelpRequiringPassphrase()); - if (GetAdjustedTime() < GetSporkValue(SPORK_20_ENABLE_ZEROCOIN)) - throw JSONRPCError(RPC_WALLET_ERROR, "Error: Zerocoin functionality is not enabled on the Ittrium network yet."); - - if(GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) + if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) throw JSONRPCError(RPC_WALLET_ERROR, "zXIT is currently disabled due to maintenance."); int64_t nTimeStart = GetTimeMillis(); diff --git a/src/serialize.h b/src/serialize.h index f8587c5..167c70e 100755 --- a/src/serialize.h +++ b/src/serialize.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2015-2018 The PIVX developers +// Copyright (c) 2015-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/spork.cpp b/src/spork.cpp index be4cde9..85e5604 100755 --- a/src/spork.cpp +++ b/src/spork.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2016 The Dash developers // Copyright (c) 2016-2018 The PIVX developers -// Copyright (c) 2018-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -63,31 +63,39 @@ void ProcessSpork(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) if (fLiteMode) return; //disable all obfuscation/masternode related functionality if (strCommand == "spork") { - //LogPrintf("ProcessSpork::spork\n"); + if(fDebug) LogPrintf("%s: spork\n", __func__); + CDataStream vMsg(vRecv); CSporkMessage spork; vRecv >> spork; - if (chainActive.Tip() == NULL) return; + if (chainActive.Tip() == NULL) { + if(fDebug) LogPrintf("%s: chainActive.Tip() is null\n", __func__); + return; + } // Ignore spork messages about unknown/deleted sporks std::string strSpork = sporkManager.GetSporkNameByID(spork.nSporkID); - if (strSpork == "Unknown") return; + if (strSpork == "Unknown") { + if(fDebug) LogPrintf("%s: unknown spork\n", __func__); + return; + } uint256 hash = spork.GetHash(); if (mapSporksActive.count(spork.nSporkID)) { if (mapSporksActive[spork.nSporkID].nTimeSigned >= spork.nTimeSigned) { - if (fDebug) LogPrintf("spork - seen %s block %d \n", hash.ToString(), chainActive.Tip()->nHeight); + if(fDebug) LogPrintf("%s: seen %s block %d \n", __func__, hash.ToString(), chainActive.Tip()->nHeight); + return; } else { - if (fDebug) LogPrintf("spork - got updated spork %s block %d \n", hash.ToString(), chainActive.Tip()->nHeight); + if(fDebug) LogPrintf("%s: got updated spork %s block %d \n", __func__, hash.ToString(), chainActive.Tip()->nHeight); } } LogPrintf("spork - new %s ID %d Time %d bestHeight %d\n", hash.ToString(), spork.nSporkID, spork.nValue, chainActive.Tip()->nHeight); if (!sporkManager.CheckSignature(spork)) { - LogPrintf("spork - invalid signature\n"); + LogPrintf("%s: invalid signature\n", __func__); Misbehaving(pfrom->GetId(), 100); return; } @@ -96,9 +104,6 @@ void ProcessSpork(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) mapSporksActive[spork.nSporkID] = spork; sporkManager.Relay(spork); - //does a task if needed - ExecuteSpork(spork.nSporkID, spork.nValue); - // Ittrium: add to spork database. pSporkDB->WriteSpork(spork.nSporkID, spork); } @@ -126,17 +131,10 @@ int64_t GetSporkValue(int nSporkID) if (nSporkID == SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT) r = SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT_DEFAULT; if (nSporkID == SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT) r = SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT_DEFAULT; if (nSporkID == SPORK_10_MASTERNODE_PAY_UPDATED_NODES) r = SPORK_10_MASTERNODE_PAY_UPDATED_NODES_DEFAULT; - if (nSporkID == SPORK_11_RESET_BUDGET) r = SPORK_11_RESET_BUDGET_DEFAULT; - if (nSporkID == SPORK_12_RECONSIDER_BLOCKS) r = SPORK_12_RECONSIDER_BLOCKS_DEFAULT; if (nSporkID == SPORK_13_ENABLE_SUPERBLOCKS) r = SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT; if (nSporkID == SPORK_14_NEW_PROTOCOL_ENFORCEMENT) r = SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT; if (nSporkID == SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) r = SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT; - if (nSporkID == SPORK_16_MN_WINNER_MINIMUM_AGE) r = SPORK_16_MN_WINNER_MINIMUM_AGE_DEFAULT; - if (nSporkID == SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3) r = SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3_DEFAULT; - if (nSporkID == SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4) r = SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4_DEFAULT; - if (nSporkID == SPORK_19_NEW_PROTOCOL_DYNAMIC) r = SPORK_19_NEW_PROTOCOL_DYNAMIC_DEFAULT; - if (nSporkID == SPORK_20_ENABLE_ZEROCOIN) r = SPORK_20_ENABLE_ZEROCOIN_DEFAULT; - if (nSporkID == SPORK_21_ZEROCOIN_MAINTENANCE_MODE) r = SPORK_21_ZEROCOIN_MAINTENANCE_MODE_DEFAULT; + if (nSporkID == SPORK_16_ZEROCOIN_MAINTENANCE_MODE) r = SPORK_16_ZEROCOIN_MAINTENANCE_MODE_DEFAULT; if (r == -1) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID); } @@ -152,19 +150,6 @@ bool IsSporkActive(int nSporkID) return r < GetTime(); } -void ExecuteSpork(int nSporkID, int nValue) -{ - if (nSporkID == SPORK_11_RESET_BUDGET && nValue == 1) { - budget.Clear(); - } - - //correct fork via spork technology - if (nSporkID == SPORK_12_RECONSIDER_BLOCKS && nValue > 0) { - LogPrintf("Spork::ExecuteSpork -- Reconsider Last %d Blocks\n", nValue); - - ReprocessBlocks(nValue); - } -} void ReprocessBlocks(int nBlocks) { @@ -285,17 +270,10 @@ int CSporkManager::GetSporkIDByName(std::string strName) if (strName == "SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT") return SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT; if (strName == "SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT") return SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT; if (strName == "SPORK_10_MASTERNODE_PAY_UPDATED_NODES") return SPORK_10_MASTERNODE_PAY_UPDATED_NODES; - if (strName == "SPORK_11_RESET_BUDGET") return SPORK_11_RESET_BUDGET; - if (strName == "SPORK_12_RECONSIDER_BLOCKS") return SPORK_12_RECONSIDER_BLOCKS; if (strName == "SPORK_13_ENABLE_SUPERBLOCKS") return SPORK_13_ENABLE_SUPERBLOCKS; if (strName == "SPORK_14_NEW_PROTOCOL_ENFORCEMENT") return SPORK_14_NEW_PROTOCOL_ENFORCEMENT; if (strName == "SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2") return SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2; - if (strName == "SPORK_16_MN_WINNER_MINIMUM_AGE") return SPORK_16_MN_WINNER_MINIMUM_AGE; - if (strName == "SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3") return SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3; - if (strName == "SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4") return SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4; - if (strName == "SPORK_19_NEW_PROTOCOL_DYNAMIC") return SPORK_19_NEW_PROTOCOL_DYNAMIC; - if (strName == "SPORK_20_ENABLE_ZEROCOIN") return SPORK_20_ENABLE_ZEROCOIN; - if (strName == "SPORK_21_ZEROCOIN_MAINTENANCE_MODE") return SPORK_21_ZEROCOIN_MAINTENANCE_MODE; + if (strName == "SPORK_16_ZEROCOIN_MAINTENANCE_MODE") return SPORK_16_ZEROCOIN_MAINTENANCE_MODE; return -1; } @@ -309,17 +287,10 @@ std::string CSporkManager::GetSporkNameByID(int id) if (id == SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT) return "SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT"; if (id == SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT) return "SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT"; if (id == SPORK_10_MASTERNODE_PAY_UPDATED_NODES) return "SPORK_10_MASTERNODE_PAY_UPDATED_NODES"; - if (id == SPORK_11_RESET_BUDGET) return "SPORK_11_RESET_BUDGET"; - if (id == SPORK_12_RECONSIDER_BLOCKS) return "SPORK_12_RECONSIDER_BLOCKS"; if (id == SPORK_13_ENABLE_SUPERBLOCKS) return "SPORK_13_ENABLE_SUPERBLOCKS"; if (id == SPORK_14_NEW_PROTOCOL_ENFORCEMENT) return "SPORK_14_NEW_PROTOCOL_ENFORCEMENT"; if (id == SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) return "SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2"; - if (id == SPORK_16_MN_WINNER_MINIMUM_AGE) return "SPORK_16_MN_WINNER_MINIMUM_AGE"; - if (id == SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3) return "SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3"; - if (id == SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4) return "SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4"; - if (id == SPORK_19_NEW_PROTOCOL_DYNAMIC) return "SPORK_19_NEW_PROTOCOL_DYNAMIC"; - if (id == SPORK_20_ENABLE_ZEROCOIN) return "SPORK_20_ENABLE_ZEROCOIN"; - if (id == SPORK_21_ZEROCOIN_MAINTENANCE_MODE) return "SPORK_21_ZEROCOIN_MAINTENANCE_MODE"; + if (id == SPORK_16_ZEROCOIN_MAINTENANCE_MODE) return "SPORK_16_ZEROCOIN_MAINTENANCE_MODE"; return "Unknown"; } diff --git a/src/spork.h b/src/spork.h index 4a739b0..b733adc 100755 --- a/src/spork.h +++ b/src/spork.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -24,9 +24,11 @@ using namespace boost; /* Don't ever reuse these IDs for other sporks - This would result in old clients getting confused about which spork is for what + + Sporks 11,12, and 16 to be removed with 1st zerocoin release */ #define SPORK_START 10001 -#define SPORK_END 10020 +#define SPORK_END 10015 #define SPORK_2_SWIFTTX 10001 #define SPORK_3_SWIFTTX_BLOCK_FILTERING 10002 @@ -35,41 +37,26 @@ using namespace boost; #define SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT 10007 #define SPORK_9_MASTERNODE_BUDGET_ENFORCEMENT 10008 #define SPORK_10_MASTERNODE_PAY_UPDATED_NODES 10009 -#define SPORK_11_RESET_BUDGET 10010 -#define SPORK_12_RECONSIDER_BLOCKS 10011 +//#define SPORK_11_LOCK_INVALID_UTXO 10010 +//#define SPORK_12_RECONSIDER_BLOCKS 10011 #define SPORK_13_ENABLE_SUPERBLOCKS 10012 #define SPORK_14_NEW_PROTOCOL_ENFORCEMENT 10013 #define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2 10014 -#define SPORK_16_MN_WINNER_MINIMUM_AGE 10015 -#define SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3 10016 -#define SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4 10017 -#define SPORK_19_NEW_PROTOCOL_DYNAMIC 10018 -#define SPORK_20_ENABLE_ZEROCOIN 10019 -#define SPORK_21_ZEROCOIN_MAINTENANCE_MODE 10020 +#define SPORK_16_ZEROCOIN_MAINTENANCE_MODE 10015 #define SPORK_2_SWIFTTX_DEFAULT 978307200 //2001-1-1 #define SPORK_3_SWIFTTX_BLOCK_FILTERING_DEFAULT 1424217600 //2015-2-18 -#define SPORK_5_MAX_VALUE_DEFAULT 1000 //1000 XIT +// changed by XIT +#define SPORK_5_MAX_VALUE_DEFAULT 5000 //5000 XIT #define SPORK_7_MASTERNODE_SCANNING_DEFAULT 978307200 //2001-1-1 -#define SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT_DEFAULT 1531526400 //2018-7-14 +#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 1529804022 //2018-6-24 -#define SPORK_11_RESET_BUDGET_DEFAULT 0 -#define SPORK_12_RECONSIDER_BLOCKS_DEFAULT 0 +#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 1512087450 //ON -#define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT 1512087450 //ON -#define SPORK_16_MN_WINNER_MINIMUM_AGE_DEFAULT 8000 // Age in seconds. This should be > MASTERNODE_REMOVAL_SECONDS to avoid - // misconfigured new nodes in the list. - // Set this to zero to emulate classic behaviour -#define SPORK_17_NEW_PROTOCOL_ENFORCEMENT_3_DEFAULT 1529303404 //ON -#define SPORK_18_NEW_PROTOCOL_ENFORCEMENT_4_DEFAULT 4070908800 //OFF - // Will be whatever value is provided during spork update. - // Example `spork SPORK_21_NEW_PROTOCOL_ENFORCEMENT_4 70910` will set active - // protocol version to `70911`. -#define SPORK_19_NEW_PROTOCOL_DYNAMIC_DEFAULT 4070908800 //OFF -#define SPORK_20_ENABLE_ZEROCOIN_DEFAULT 4070908800 //OFF -#define SPORK_21_ZEROCOIN_MAINTENANCE_MODE_DEFAULT 4070908800 //OFF +#define SPORK_14_NEW_PROTOCOL_ENFORCEMENT_DEFAULT 4070908800 //OFF +#define SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2_DEFAULT 1546486413 //On +#define SPORK_16_ZEROCOIN_MAINTENANCE_MODE_DEFAULT 1546486413 //On class CSporkMessage; class CSporkManager; @@ -82,7 +69,6 @@ void LoadSporksFromDB(); void ProcessSpork(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); int64_t GetSporkValue(int nSporkID); bool IsSporkActive(int nSporkID); -void ExecuteSpork(int nSporkID, int nValue); void ReprocessBlocks(int nBlocks); // diff --git a/src/swifttx.cpp b/src/swifttx.cpp index df6d4b3..5ebd609 100755 --- a/src/swifttx.cpp +++ b/src/swifttx.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2014-2016 The Dash developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/swifttx.h b/src/swifttx.h index ba35996..3a800e9 100755 --- a/src/swifttx.h +++ b/src/swifttx.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/txdb.cpp b/src/txdb.cpp index 5ad4191..156e5f3 100755 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/txdb.h b/src/txdb.h index e0b79c9..ace2083 100755 --- a/src/txdb.h +++ b/src/txdb.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/txmempool.cpp b/src/txmempool.cpp index f9358f1..1d3b2e5 100755 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/txmempool.h b/src/txmempool.h index 0758cf7..4700a96 100755 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -18,7 +19,7 @@ class CAutoFile; inline double AllowFreeThreshold() { - return COIN * 144 / 250; + return COIN * 1440 / 250; } inline bool AllowFree(double dPriority) diff --git a/src/uint256.h b/src/uint256.h index 3ff9dfa..4ae947a 100755 --- a/src/uint256.h +++ b/src/uint256.h @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/uint512.h b/src/uint512.h index 94dfda6..93e8a6c 100755 --- a/src/uint512.h +++ b/src/uint512.h @@ -1,4 +1,5 @@ // Copyright (c) 2017 The PIVX Core developers +// Copyright (c) 2017 The Ittrium Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/util.cpp b/src/util.cpp index 187ca0d..0363fe5 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/util.h b/src/util.h index c064552..0c54a1c 100755 --- a/src/util.h +++ b/src/util.h @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 238b42f..eb127cb 100755 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utilstrencodings.h b/src/utilstrencodings.h index fd13a0c..11f2a61 100755 --- a/src/utilstrencodings.h +++ b/src/utilstrencodings.h @@ -50,7 +50,6 @@ int atoi(const std::string& str); * @returns true if the entire string could be parsed as valid integer, * false if not the entire string could be parsed or when overflow or underflow occurred. */ - bool ParseInt32(const std::string& str, int32_t *out); /** @@ -67,7 +66,6 @@ bool ParseInt64(const std::string& str, int64_t *out); */ bool ParseDouble(const std::string& str, double *out); - template std::string HexStr(const T itbegin, const T itend, bool fSpaces = false) { diff --git a/src/utiltime.h b/src/utiltime.h index b1447f7..3c63479 100755 --- a/src/utiltime.h +++ b/src/utiltime.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/version.h b/src/version.h index 2ba75eb..809c6f7 100755 --- a/src/version.h +++ b/src/version.h @@ -1,7 +1,7 @@ // Copyright (c) 2012-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -11,19 +11,18 @@ /** * network protocol versioning */ -static const int PROTOCOL_VERSION = 70911; + +static const int PROTOCOL_VERSION = 70912; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; //! In this version, 'getheaders' was introduced. -static const int GETHEADERS_VERSION = 70911; +static const int GETHEADERS_VERSION = 70077; //! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70911; -static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT15 = 70811; -static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT17 = 70900; -static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT18 = 70911; +static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70912; +static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70912; //! nTime field added to CAddress, starting with this version; //! if possible, avoid requesting addresses nodes older than this diff --git a/src/wallet.cpp b/src/wallet.cpp index 199bd65..b7df094 100755 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -432,7 +432,6 @@ bool CWallet::IsSpent(const uint256& hash, unsigned int n) const const COutPoint outpoint(hash, n); pair range; range = mapTxSpends.equal_range(outpoint); - for (TxSpends::const_iterator it = range.first; it != range.second; ++it) { const uint256& wtxid = it->second; std::map::const_iterator mit = mapWallet.find(wtxid); @@ -445,7 +444,6 @@ bool CWallet::IsSpent(const uint256& hash, unsigned int n) const void CWallet::AddToSpends(const COutPoint& outpoint, const uint256& wtxid) { mapTxSpends.insert(make_pair(outpoint, wtxid)); - pair range; range = mapTxSpends.equal_range(outpoint); SyncMetaData(range); @@ -1276,7 +1274,6 @@ void CWallet::ResendWalletTransactions() * @{ */ - CAmount CWallet::GetBalance() const { CAmount nTotal = 0; @@ -1759,26 +1756,11 @@ bool CWallet::SelectStakeCoins(std::set= Params().Stake_MinProtocol()) { - nStakeAmount = Params().Stake_MinAmount(); - nStakeDepth = Params().Stake_MinConfirmations(); - } BOOST_FOREACH (const COutput& out, vCoins) { //make sure not to outrun target amount if (nAmountSelected + out.tx->vout[out.i].nValue > nTargetAmount) continue; - - //require a minimum amount to stake - if (out.tx->vout[out.i].nValue < nStakeAmount) - continue; - - //check that it is matured - if (out.nDepth < (out.tx->IsCoinStake() ? nStakeDepth : 10)) - continue; //if zerocoinspend, then use the block time int64_t nTxTime = out.tx->GetTxTime(); @@ -1796,7 +1778,6 @@ bool CWallet::SelectStakeCoins(std::setvout[out.i].nValue; } - return true; } @@ -2987,7 +2968,6 @@ DBErrors CWallet::ZapWalletTx(std::vector& vWtx) return DB_LOAD_OK; } - bool CWallet::SetAddressBook(const CTxDestination& address, const string& strName, const string& strPurpose) { bool fUpdated = false; @@ -3547,8 +3527,7 @@ bool CWallet::GetDestData(const CTxDestination& dest, const std::string& key, st void CWallet::AutoZeromint() { // Don't bother Autominting if Zerocoin Protocol isn't active - if (!IsSporkActive(SPORK_20_ENABLE_ZEROCOIN)) return; - if (GetAdjustedTime() > GetSporkValue(SPORK_21_ZEROCOIN_MAINTENANCE_MODE)) return; + if (GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) return; // Wait until blockchain + masternodes are fully synced and wallet is unlocked. if (!masternodeSync.IsSynced() || IsLocked()){ @@ -3649,43 +3628,32 @@ void CWallet::AutoZeromint() void CWallet::AutoCombineDust() { - LOCK2(cs_main, cs_wallet); - if (chainActive.Tip()->nTime < (GetAdjustedTime() - 300) || IsLocked()) { + if (IsInitialBlockDownload() || IsLocked()) { return; } - map > mapCoinsByAddress = AvailableCoinsByAddress(true, nAutoCombineThreshold * COIN); + map > mapCoinsByAddress = AvailableCoinsByAddress(true, 0); //coins are sectioned by address. This combination code only wants to combine inputs that belong to the same address for (map >::iterator it = mapCoinsByAddress.begin(); it != mapCoinsByAddress.end(); it++) { vector vCoins, vRewardCoins; vCoins = it->second; - // We don't want the tx to be refused for being too large - // we use 50 bytes as a base tx size (2 output: 2*34 + overhead: 10 -> 90 to be certain) - unsigned int txSizeEstimate = 90; - //find masternode rewards that need to be combined CCoinControl* coinControl = new CCoinControl(); CAmount nTotalRewardsValue = 0; BOOST_FOREACH (const COutput& out, vCoins) { //no coins should get this far if they dont have proper maturity, this is double checking - if (out.tx->IsCoinStake() && out.tx->GetDepthInMainChain() < COINBASE_MATURITY + 1) + if (out.tx->IsCoinStake() && out.tx->GetDepthInMainChain() < Params().COINBASE_MATURITY() + 1) + continue; + + if (out.Value() > nAutoCombineThreshold * COIN) continue; COutPoint outpt(out.tx->GetHash(), out.i); coinControl->Select(outpt); vRewardCoins.push_back(out); nTotalRewardsValue += out.Value(); - - // Combine to the threshold and not way above - if (nTotalRewardsValue > nAutoCombineThreshold * COIN) - break; - - // Around 180 bytes per input. We use 190 to be certain - txSizeEstimate += 190; - if (txSizeEstimate >= MAX_STANDARD_TX_SIZE - 200) - break; } //if no inputs found then return @@ -3716,10 +3684,6 @@ void CWallet::AutoCombineDust() continue; } - //we don't combine below the threshold unless the fees are 0 to avoid paying fees over fees over fees - if (nTotalRewardsValue < nAutoCombineThreshold * COIN && nFeeRet > 0) - continue; - if (!CommitTransaction(wtx, keyChange)) { LogPrintf("AutoCombineDust transaction commit failed\n"); continue; @@ -3749,7 +3713,7 @@ bool CWallet::MultiSend() bool mnSent = false; for (const COutput& out : vCoins) { //need output with precise confirm count - this is how we identify which is the output to send - if (out.tx->GetDepthInMainChain() != COINBASE_MATURITY + 1) + if (out.tx->GetDepthInMainChain() != Params().COINBASE_MATURITY() + 1) continue; COutPoint outpoint(out.tx->GetHash(), out.i); @@ -4172,7 +4136,7 @@ bool CWallet::MintToTxIn(CZerocoinMint zerocoinSelected, int nSecurityLevel, con serializedCoinSpend << spend; std::vector data(serializedCoinSpend.begin(), serializedCoinSpend.end()); - //Add the coin spend into a xit transaction + //Add the coin spend into a Ittrium transaction newTxIn.scriptSig = CScript() << OP_ZEROCOINSPEND << data.size(); newTxIn.scriptSig.insert(newTxIn.scriptSig.end(), data.begin(), data.end()); newTxIn.prevout.SetNull(); @@ -4375,7 +4339,7 @@ bool CWallet::CreateZerocoinSpendTransaction(CAmount nValue, int nSecurityLevel, } } - //add output to xit address to the transaction (the actual primary spend taking place) + //add output to ittrium address to the transaction (the actual primary spend taking place) CTxOut txOutZerocoinSpend(nValue, scriptZerocoinSpend); txNew.vout.push_back(txOutZerocoinSpend); diff --git a/src/wallet_ismine.cpp b/src/wallet_ismine.cpp index 226d612..57b84cf 100755 --- a/src/wallet_ismine.cpp +++ b/src/wallet_ismine.cpp @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2016-2017 The Ittrium developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/walletdb.cpp b/src/walletdb.cpp index b0143ef..7ebb3c5 100755 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -2,7 +2,7 @@ // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers -// Copyright (c) 2017-2018 The Ittrium developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/walletdb.h b/src/walletdb.h index 0044410..e09fb0f 100755 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -1,6 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin developers // Copyright (c) 2016-2017 The PIVX developers +// Copyright (c) 2018-2019 The Ittrium developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php.