From de28698e2a648e759b6fb041c7a30788eaba7ddf Mon Sep 17 00:00:00 2001 From: CryptoCoderz Date: Tue, 21 May 2019 00:28:27 -0700 Subject: [PATCH] DigitalNote v1.0.1.3 Release Changelog - Version bump - Disabled masternode recipient check during initial sync (fixes issues for user when syncing with mainnet) - Implementation cleanup --- DigitalNote.pro | 2 +- src/chainparams.cpp | 1 - src/chainparams.h | 2 -- src/clientversion.h | 2 +- src/main.cpp | 12 ++++++++++-- src/rpcmining.cpp | 2 +- src/version.h | 2 +- src/wallet.cpp | 27 ++++++++++++++------------- 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/DigitalNote.pro b/DigitalNote.pro index a484ca2c..d3bc778a 100644 --- a/DigitalNote.pro +++ b/DigitalNote.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = DigitalNote-qt -VERSION = 1.0.1.2 +VERSION = 1.0.1.3 INCLUDEPATH += src src/json src/qt src/qt/plugins/mrichtexteditor QT += core gui widgets network printsupport DEFINES += ENABLE_WALLET diff --git a/src/chainparams.cpp b/src/chainparams.cpp index b2fb697c..9d424ab1 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -102,7 +102,6 @@ class CMainParams : public CChainParams { nPoolMaxTransactions = 9; strMNenginePoolDummyAddress = "dUnVN6zz2apaoWkb5krGoBCwwo8ZD3axue"; - // TODO: Verify upgrade strDevOpsAddress = "dSCXLHTZJJqTej8ZRszZxbLrS6dDGVJhw7"; strDevOpsScriptPubKey = "76a9148c2fad4e8bdfdc047ad5ad5378084de415e1538988ac"; nEndPoWBlock = 0x7fffffff; diff --git a/src/chainparams.h b/src/chainparams.h index 302e429e..b6b194ea 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -72,7 +72,6 @@ class CChainParams int StartPoSBlock() const { return nStartPoSBlock; } int PoolMaxTransactions() const { return nPoolMaxTransactions; } std::string MNenginePoolDummyAddress() const { return strMNenginePoolDummyAddress; } - // TODO: Verify upgrade std::string DevOpsAddress() const { return strDevOpsAddress; } std::string DevOpsPubKey() const { return strDevOpsScriptPubKey; } protected: @@ -93,7 +92,6 @@ class CChainParams int nStartPoSBlock; int nPoolMaxTransactions; std::string strMNenginePoolDummyAddress; - // TODO: Verify upgrade std::string strDevOpsAddress; std::string strDevOpsScriptPubKey; }; diff --git a/src/clientversion.h b/src/clientversion.h index bd3487d3..f4f85837 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 0 #define CLIENT_VERSION_REVISION 1 -#define CLIENT_VERSION_BUILD 2 +#define CLIENT_VERSION_BUILD 3 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/main.cpp b/src/main.cpp index d2f02130..0f4de7ad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2678,7 +2678,11 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c LogPrintf("CheckBlock() : PoS Recipient masternode address validity succesfully verified\n"); } else { LogPrintf("CheckBlock() : PoS Recipient masternode address validity could not be verified\n"); - fBlockHasPayments = false; + if (!fIsInitialDownload) { + fBlockHasPayments = false; + } else { + LogPrintf("CheckBlock() : PoS Recipient masternode address validity skipping, syncing in progress!\n"); + } } if (nIndexedMasternodePayment == nMasternodePayment) { LogPrintf("CheckBlock() : PoS Recipient masternode amount validity succesfully verified\n"); @@ -2713,7 +2717,11 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c LogPrintf("CheckBlock() : PoW Recipient masternode address validity succesfully verified\n"); } else { LogPrintf("CheckBlock() : PoW Recipient masternode address validity could not be verified\n"); - fBlockHasPayments = false; + if (!fIsInitialDownload) { + fBlockHasPayments = false; + } else { + LogPrintf("CheckBlock() : PoW Recipient masternode address validity skipping, syncing in progress!\n"); + } } if (nAmount == nMasternodePayment) { LogPrintf("CheckBlock() : PoW Recipient masternode amount validity succesfully verified\n"); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index ce2bb715..0ef7622d 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -674,7 +674,7 @@ Value getblocktemplate(const Array& params, bool fHelp) result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); result.push_back(Pair("votes", aVotes)); - // TODO: Verify upgrade + // Check for payment upgrade fork if (pindexBest->GetBlockTime() > 0) { if (pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM diff --git a/src/version.h b/src/version.h index 490e57b4..37732167 100644 --- a/src/version.h +++ b/src/version.h @@ -30,7 +30,7 @@ static const int DATABASE_VERSION = 70509; // // network protocol versioning // -static const int PROTOCOL_VERSION = 62009; +static const int PROTOCOL_VERSION = 62010; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; diff --git a/src/wallet.cpp b/src/wallet.cpp index 1b35d601..3592dc97 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2887,9 +2887,11 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int txNew.vin.clear(); txNew.vout.clear(); + // OLD IMPLEMENTATION COMMNETED OUT + // // Determine our payment script for devops - CScript devopsScript; - devopsScript << OP_DUP << OP_HASH160 << ParseHex(Params().DevOpsPubKey()) << OP_EQUALVERIFY << OP_CHECKSIG; + // CScript devopsScript; + // devopsScript << OP_DUP << OP_HASH160 << ParseHex(Params().DevOpsPubKey()) << OP_EQUALVERIFY << OP_CHECKSIG; // Mark coin stake transaction CScript scriptEmpty; @@ -3048,6 +3050,15 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int CTxIn vin; nPoSageReward = nReward; + // define address + CBitcoinAddress devopaddress; + if (Params().NetworkID() == CChainParams::MAIN) + devopaddress = CBitcoinAddress("dSCXLHTZJJqTej8ZRszZxbLrS6dDGVJhw7"); // TODO: nothing, already set to a valid DigitalNote address + else if (Params().NetworkID() == CChainParams::TESTNET) + devopaddress = CBitcoinAddress(""); + else if (Params().NetworkID() == CChainParams::REGTEST) + devopaddress = CBitcoinAddress(""); + // Masternode Payments int payments = 1; // start masternode payments @@ -3081,7 +3092,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int if(winningNode){ payee = GetScriptForDestination(winningNode->pubkey.GetID()); } else { - payee = devopsScript; + payee = GetScriptForDestination(devopaddress.Get()); } } } else { @@ -3132,15 +3143,6 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int bool hasdevopsPay = true; if(bDevOpsPayment) { - // define address - CBitcoinAddress devopaddress; - if (Params().NetworkID() == CChainParams::MAIN) - devopaddress = CBitcoinAddress("dSCXLHTZJJqTej8ZRszZxbLrS6dDGVJhw7"); // TODO: nothing, already set to a valid DigitalNote address - else if (Params().NetworkID() == CChainParams::TESTNET) - devopaddress = CBitcoinAddress(""); - else if (Params().NetworkID() == CChainParams::REGTEST) - devopaddress = CBitcoinAddress(""); - // verify address if(devopaddress.IsValid()) { @@ -3156,7 +3158,6 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int { return error("CreateCoinStake: Failed to detect dev address to pay\n"); } - } else { hasdevopsPay = false;