Skip to content

Commit

Permalink
Merge pull request #1 from TrianglesCommunityProject/master
Browse files Browse the repository at this point in the history
PoS Buffer Overflow Fix
  • Loading branch information
boxxa committed Mar 14, 2015
2 parents f0e6e10 + 0a29991 commit bc47618
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,8 @@ int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees)
//else
// nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;

if(pindexBest->nHeight > 365 * DAILY_BLOCKCOUNT)
nSubsidy = nCoinAge / COIN * nRewardCoinYear / 365;
if(pindexBest->nHeight > 15000) // wurstgelee: change to desired forking block height
nSubsidy = (nCoinAge / 365) * (nRewardCoinYear / COIN);
else
nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;

Expand Down
4 changes: 2 additions & 2 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
using namespace std;
extern unsigned int nStakeMaxAge;

unsigned int nStakeSplitAge = 1 * 24 * 60 * 60;
int64_t nStakeCombineThreshold = 1000 * COIN;
unsigned int nStakeSplitAge = 3 * 24 * 60 * 60; //wurstgelee: 3x nStakeMinAge so splitting does actually happen.
int64_t nStakeCombineThreshold = 200 * COIN; //Lower threshold results in steady block creation due to more overall inputs in network. Also helps to prevent hitting PoS reward calculation buffer overflow.

//////////////////////////////////////////////////////////////////////////////
//
Expand Down

0 comments on commit bc47618

Please sign in to comment.