Skip to content

Commit

Permalink
Block Reward between 25 and 50
Browse files Browse the repository at this point in the history
client version 0.12.9.0, our first release
  • Loading branch information
Krekeler committed Aug 26, 2018
1 parent 3a13334 commit 0ca03b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class CMainParams : public CChainParams {
nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour

strSporkAddress = "DJ7YjNsc8TYHetDbwsxeNZTzyQzQPKCaxW"; // TODO is Dummy only https://github.com/dashpay/dash/commit/611879aa6d973ab995088647d701a4747d0716d3#diff-64cbe1ad5465e13bc59ee8bb6f3de2e7
strSporkAddress = "DN8GxA2zrozDSDQYedkTznf4jFC4Ujgddr"; // TODO https://github.com/dashpay/dash/commit/611879aa6d973ab995088647d701a4747d0716d3#diff-64cbe1ad5465e13bc59ee8bb6f3de2e7

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
//! These need to be macros, as clientversion.cpp's and dms*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 12
#define CLIENT_VERSION_REVISION 3
#define CLIENT_VERSION_BUILD 2
#define CLIENT_VERSION_REVISION 9
#define CLIENT_VERSION_BUILD 0

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
12 changes: 11 additions & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,13 +1292,17 @@ CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params&
double dDiff;
CAmount nSubsidyBase;

/*
if (nPrevHeight <= 4500 && Params().NetworkIDString() == CBaseChainParams::MAIN) {
/* a bug which caused diff to not be correctly calculated */
// Dash: a bug which caused diff to not be correctly calculated
dDiff = (double)0x0000ffff / (double)(nPrevBits & 0x00ffffff);
} else {
dDiff = ConvertBitsToDouble(nPrevBits);
}
*/
dDiff = ConvertBitsToDouble(nPrevBits);

/* Dash:
if (nPrevHeight < 5465) {
// Early ages...
// 1111/((x+1)^2)
Expand All @@ -1318,6 +1322,12 @@ CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params&
if(nSubsidyBase > 25) nSubsidyBase = 25;
else if(nSubsidyBase < 5) nSubsidyBase = 5;
}
*/
// DMS: CPU mining era, reward 25 - 50 DMS
// 11111/(((x+51)/6)^2)
nSubsidyBase = (11111.0 / (pow((dDiff+51.0)/6.0,2.0)));
if(nSubsidyBase > 50) nSubsidyBase = 50;
else if(nSubsidyBase < 25) nSubsidyBase = 25;

// LogPrintf("height %u diff %4.2f reward %d\n", nPrevHeight, dDiff, nSubsidyBase);
CAmount nSubsidy = nSubsidyBase * COIN;
Expand Down

1 comment on commit 0ca03b7

@Krekeler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blockchain started after this Commit

Please sign in to comment.