Skip to content

Commit

Permalink
Reward tweak
Browse files Browse the repository at this point in the history
We have to keep old undefined calculation so that everyone remains on the same fork.  Behavior will be corrected at fork upgrade height.
  • Loading branch information
DrCryptoToad committed Aug 19, 2018
1 parent 421ccd0 commit 3f9fedf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions src/CryptoNoteCore/Currency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ bool Currency::generateGenesisBlock() {
}

uint64_t Currency::baseRewardFunction(uint64_t alreadyGeneratedCoins, uint32_t height) const {
uint64_t base_reward = START_BLOCK_REWARD >> (static_cast<uint64_t>(height) / REWARD_HALVING_INTERVAL);
base_reward = (std::max)(base_reward, MIN_BLOCK_REWARD);
//block 704000 reward fix at 12AM CST 8/20/18
if (height >= parameters::UPGRADE_HEIGHT_V6)
base_reward = MIN_BLOCK_REWARD;
base_reward = (std::min)(base_reward, m_moneySupply - alreadyGeneratedCoins);
return base_reward;
uint64_t base_reward;
if (height < parameters::UPGRADE_HEIGHT_V6)
base_reward = START_BLOCK_REWARD >> (static_cast<uint64_t>(height) / REWARD_HALVING_INTERVAL);
else
{
uint64_t shift = static_cast<uint64_t>(height) / REWARD_HALVING_INTERVAL;
base_reward = shift >= 64 ? 0 : START_BLOCK_REWARD >> shift;
}
base_reward = (std::max)(base_reward, MIN_BLOCK_REWARD);
base_reward = (std::min)(base_reward, m_moneySupply - alreadyGeneratedCoins);
return base_reward;
}

size_t Currency::blockGrantedFullRewardZoneByBlockVersion(uint8_t blockMajorVersion) const {
Expand Down
4 changes: 2 additions & 2 deletions src/version.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "6.0.0-beta"
#define PROJECT_VERSION_BUILD_NO "1806"
#define PROJECT_VERSION "6.0.1-beta"
#define PROJECT_VERSION_BUILD_NO "1807"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"

0 comments on commit 3f9fedf

Please sign in to comment.