Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d178a69
Update README.md
CryptoCoderz Apr 10, 2019
6057280
Updated masternode payment
CryptoCoderz Apr 21, 2019
3c1dd2a
Updated coinbase/coinstake rewards
CryptoCoderz Apr 22, 2019
c9678fb
Added Experimental fork toggle
CryptoCoderz Apr 24, 2019
19232f6
Set static payout for test fork
CryptoCoderz Apr 26, 2019
b3e4b4f
Included diff reset for live fork testing
CryptoCoderz Apr 26, 2019
82d7a04
Updated masternode/devops payments 1
CryptoCoderz Apr 27, 2019
ae200ed
prevent potential segfault if no mnwinner retrieved
Apr 27, 2019
5b27c64
Merge pull request #1 from barrystyle/winningnode
CryptoCoderz Apr 27, 2019
1790f38
Update main.cpp
CryptoCoderz Apr 27, 2019
b7f2eb1
Merge branch 'master' of https://github.com/CryptoCoderz/DigitalNote
CryptoCoderz Apr 27, 2019
96f65d1
Updated masternode/devops payments 2
CryptoCoderz Apr 28, 2019
626455a
Updated masternode/devops payments 3
CryptoCoderz Apr 29, 2019
4b130bb
Updated masternode/devops payments 4
CryptoCoderz Apr 30, 2019
9362207
Updated masternode/devops payments 5
CryptoCoderz Apr 30, 2019
ea9aa47
fallback to paying devops, when a valid masternode destination cannot…
May 1, 2019
43352ab
test if masternode destination is valid, using an iteration method
May 1, 2019
07d7700
Merge pull request #2 from barrystyle/master
CryptoCoderz May 1, 2019
1f31f69
Updated masternode/devops payments 7
CryptoCoderz May 1, 2019
fffec19
Updated masternode/devops payments 8
CryptoCoderz May 2, 2019
d927a51
Updated masternode/devops payments 9
CryptoCoderz May 3, 2019
19eb5eb
Update CreateNewBlock() debug prints
CryptoCoderz May 3, 2019
90ba483
Update GetMasternodePayment() debug prints
CryptoCoderz May 5, 2019
525f6a7
Updated masternode/devops payments 10
CryptoCoderz May 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,9 +37,9 @@ DigitalNote uses
libsecp256k1,
libgmp,
Boost1.68, OR Boost1.58,
Openssl1.02o,
Openssl1.02r,
Berkeley DB 6.2.32,
QT5.11,
QT5.12.1,
to compile


Expand DownExpand Up@@ -139,7 +139,6 @@ The developer [mailing list](https://lists.linuxfoundation.org/mailman/listinfo/
should be used to discuss complicated or controversial changes before working
on a patch set.

<<
Developer Discord can be found at https://discord.gg/eSb7nEx.

Testing
Expand Down
2 changes: 1 addition & 1 deletion src/activemasternode.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
#include "clientversion.h"

//
// Bootup the masternode, look for a 10,000 XDN input and register on the network
// Bootup the masternode, look for a 2,000,000 XDN input and register on the network
//
void CActiveMasternode::ManageStatus()
{
Expand Down
2 changes: 1 addition & 1 deletion src/activemasternode.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,7 +49,7 @@ class CActiveMasternode
/// Register any Masternode
bool Register(CTxIn vin, CService service, CKey key, CPubKey pubKey, CKey keyMasternode, CPubKey pubKeyMasternode, CScript donationAddress, int donationPercentage, std::string &retErrorMessage);

// get 10,000 XDN input that can be used for the masternode
// get 2,000,000 XDN input that can be used for the masternode
bool GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey);
bool GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey, std::string strTxHash, std::string strOutputIndex);
bool GetMasterNodeVinForPubKey(std::string collateralAddress, CTxIn& vin, CPubKey& pubkey, CKey& secretKey);
Expand Down
39 changes: 38 additions & 1 deletion src/blockparams.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,8 @@
#include "txdb.h"
#include "velocity.h"
#include "main.h"
#include "mnengine.h"
#include "masternodeman.h"

#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
Expand DownExpand Up@@ -75,6 +77,7 @@ uint64_t cntTime = 0;
uint64_t prvTime = 0;
uint64_t difTimePoS = 0;
uint64_t difTimePoW = 0;
string loggedpayee = "";


//////////////////////////////////////////////////////////////////////////////
Expand DownExpand Up@@ -312,6 +315,17 @@ unsigned int VRX_Retarget(const CBlockIndex* pindexLast, bool fProofOfStake)
if (pindexLast->nHeight < scanheight+124)
return bnVelocity.GetCompact(); // can't index prevblock

// Live fork toggle diff reset
if(nLiveForkToggle > 0)
{
if(pindexLast->nHeight > nLiveForkToggle) // Selectable toggle
{
if(pindexLast->nHeight < nLiveForkToggle+5) {
return bnVelocity.GetCompact(); // diff reset
}
}
}

// Differentiate PoW/PoS prev block
BlockVelocityType = GetLastBlockIndex(pindexLast, fProofOfStake);

Expand DownExpand Up@@ -465,7 +479,7 @@ int64_t GetMasternodePayment(int nHeight, int64_t blockValue)
{
// Define values
int64_t ret = 0;
int64_t swingSubsidy = blockValue - (50 * COIN); // 200 XDN ceiling
int64_t swingSubsidy = blockValue - (100 * COIN); // 200 XDN ceiling
int64_t seesawHeight = nHeight;
int64_t seesawInterval = seesawHeight / 30;
int64_t seesawEpoch = seesawInterval / 15;
Expand All@@ -480,22 +494,32 @@ int64_t GetMasternodePayment(int nHeight, int64_t blockValue)
double seesawCeiling = 1;
// Set bottom of seesaw arc
seesawBase = seesawMidIncrmt;
LogPrint("creation", "GetMasternodePayment(): seesawEpoch=%lu\n", seesawEpoch);
// Adjust for arc epochs
if(seesawEpoch >= 1)
{
seesawRollover = seesawArcend * seesawEpoch;
LogPrint("creation", "GetMasternodePayment(): seesawRollover=%lu\n", seesawRollover);
seesawInterval =- seesawRollover;
LogPrint("creation", "GetMasternodePayment(): seesawInterval=%lu\n", seesawInterval);
}
else
{
LogPrint("creation", "GetMasternodePayment(): seesawRollover=%lu\n", seesawRollover);
LogPrint("creation", "GetMasternodePayment(): seesawInterval=%lu\n", seesawInterval);
}
// Seesaw downswing (first for logic order)
if(seesawInterval > seesawArc)
{
if(seesawInterval <= seesawArcend)
{
seesawBase = seesawCeiling - ((seesawIncrement * seesawInterval) - 1);
LogPrint("creation", "GetMasternodePayment(): seesawBase_1=%lu\n", seesawBase);
// Limit seesaw arc
if(seesawBase < seesawMidIncrmt)
{
seesawBase = seesawMidIncrmt;
LogPrint("creation", "GetMasternodePayment(): seesawBase_2=%lu\n", seesawBase);
}
}
}
Expand All@@ -505,15 +529,28 @@ int64_t GetMasternodePayment(int nHeight, int64_t blockValue)
if(seesawInterval <= seesawArc)
{
seesawBase = seesawIncrement * seesawInterval;
LogPrint("creation", "GetMasternodePayment(): seesawBase_3=%lu\n", seesawBase);
// Limit seesaw arc
if(seesawBase > seesawCeiling)
{
seesawBase = seesawCeiling;
LogPrint("creation", "GetMasternodePayment(): seesawBase_4=%lu\n", seesawBase);
}
}
}
// Set calculated position of seesaw arc
retDouble = swingSubsidy * seesawBase;
// v1.1 payment subsidy patch
if(nLiveForkToggle > 0)
{
if(pindexBest->nHeight > nLiveForkToggle) // Selectable toggle
{
// set returned value to calculated value
ret = retDouble;
LogPrint("creation", "GetMasternodePayment(): Value=%lu\n\n", ret);

}
}
// Return our seesaw arc value (reward in current position of arc)
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion src/blockparams.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@
#include "net.h"
#include "chain.h"
#include "bignum.h"
#include "base58.h"

#define START_MASTERNODE_PAYMENTS_TESTNET 9993058800 // OFF (NOT TOGGLED)
#define START_MASTERNODE_PAYMENTS 1554494400 // OFF (Friday, April 5, 2019 1:00:00 PM GMT-07:00 | PDT)
Expand DownExpand Up@@ -43,5 +44,4 @@ int64_t GetProofOfStakeReward(const CBlockIndex* pindexPrev, int64_t nCoinAge, i
int64_t GetMasternodePayment(int nHeight, int64_t blockValue);
int64_t GetDevOpsPayment(int nHeight, int64_t blockValue);


#endif // BITCOIN_BLOCKPARAMS_H
3 changes: 3 additions & 0 deletions src/chainparams.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,9 @@ class CMainParams : public CChainParams {

nPoolMaxTransactions = 9;
strMNenginePoolDummyAddress = "dUnVN6zz2apaoWkb5krGoBCwwo8ZD3axue";
// TODO: Verify upgrade
strDevOpsAddress = "dSCXLHTZJJqTej8ZRszZxbLrS6dDGVJhw7";
strDevOpsScriptPubKey = "76a9148c2fad4e8bdfdc047ad5ad5378084de415e1538988ac";
nEndPoWBlock = 0x7fffffff;
nStartPoSBlock = 0;
}
Expand Down
6 changes: 6 additions & 0 deletions src/chainparams.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,9 @@ 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:
CChainParams() {};

Expand All@@ -90,6 +93,9 @@ class CChainParams
int nStartPoSBlock;
int nPoolMaxTransactions;
std::string strMNenginePoolDummyAddress;
// TODO: Verify upgrade
std::string strDevOpsAddress;
std::string strDevOpsScriptPubKey;
};

/**
Expand Down
27 changes: 27 additions & 0 deletions src/init.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,6 +297,7 @@ std::string HelpMessage()
" -debugsmsg " + _("Log extra debug messages.") + "\n" +
" -smsgscanchain " + _("Scan the block chain for public key addresses on startup.") + "\n";
strUsage += " -stakethreshold=<n> " + _("This will set the output size of your stakes to never be below this number (default: 100)") + "\n";
strUsage += " -liveforktoggle=<n> " + _("Toggle experimental features via block height testing fork, (example: -command=<fork_height>)") + "\n";

return strUsage;
}
Expand DownExpand Up@@ -987,6 +988,32 @@ bool AppInit2(boost::thread_group& threadGroup)
if (!strErrors.str().empty())
return InitError(strErrors.str());

// Check toggle switch for experimental feature testing fork
uiInterface.InitMessage(_("Checking experimental feature toggle..."));
strLiveForkToggle = GetArg("-liveforktoggle", "");
LogPrintf("Checking for experimental testing feature fork toggle...\n");
if(!strLiveForkToggle.empty()){
LogPrintf("Verifying height selection for experimental testing feature fork toggle...\n");
std::istringstream(strLiveForkToggle) >> nLiveForkToggle;
if(nLiveForkToggle == 0)
{
LogPrintf("Continuing with fork toggle manually disabled by user...\n");
}
else if(nLiveForkToggle < nBestHeight)
{
return InitError(_("Invalid experimental testing feature fork toggle, please select a higher block than currently sync'd height\n"));
}
else
{
LogPrintf("Continuing with fork toggle set for block: %s | Happy testing!\n", strLiveForkToggle.c_str());
}

}
else {
nLiveForkToggle = 0;
LogPrintf("No experimental testing feature fork toggle detected... skipping...\n");
}

uiInterface.InitMessage(_("Loading masternode cache..."));

CMasternodeDB mndb;
Expand Down
Loading