Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed update to POS Minting control parameters #62

Merged
merged 3 commits into from Jul 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/README_ubuntu.txt
Expand Up @@ -130,7 +130,7 @@ Section E - Build the OpenSSL Library
of openssl we need from the Internet.

3 - Type " md5sum openssl-1.0.1g.tar.gz " and make sure you get
66bf6f10f060d561929de96f9dfe5b8c
de62b43dfcd858e66a74bee1c834e959

4 - Type " tar xvzf openssl-1.0.1g.tar.gz " to extract the source files.

Expand Down
2 changes: 1 addition & 1 deletion doc/build-msw.txt
Expand Up @@ -37,7 +37,7 @@ http://www.openssl.org/source/openssl-1.0.1g.tar.gz

7) Type:
cd /c/deps
md5sum openssl-1.0.1g.tar.gz # make sure you get 66bf6f10f060d561929de96f9dfe5b8c
md5sum openssl-1.0.1g.tar.gz # make sure you get de62b43dfcd858e66a74bee1c834e959
tar xvzf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./config
Expand Down
13 changes: 6 additions & 7 deletions src/wallet.cpp
Expand Up @@ -1395,10 +1395,11 @@ bool CWallet::CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& w
// ppcoin: create coin stake transaction
bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int64 nSearchInterval, CTransaction& txNew)
{
// The following split & combine thresholds are important to security
// Should not be adjusted if you don't understand the consequences
static unsigned int nStakeSplitAge = (60 * 60 * 24 * 90);
int64 nCombineThreshold = GetProofOfWorkReward(GetLastBlockIndex(pindexBest, false)->nBits) / 3;
// Keep combining coins until 10 times POW reward is reached.
int64 nCombineThreshold = GetProofOfWorkReward(GetLastBlockIndex(pindexBest, false)->nBits) * 10;
// Minimum age for coins that will be combined.
unsigned int nStakeCombineAge = 60 * 60 * 24 * 31;

// Keep a table of stuff to speed up POS mining
static map<uint256, PosMiningStuff *> mapMiningStuff;

Expand Down Expand Up @@ -1523,8 +1524,6 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
nCredit += pcoin.first->vout[pcoin.second].nValue;
vwtxPrev.push_back(pcoin.first);
txNew.vout.push_back(CTxOut(0, scriptPubKeyOut));
if (block.GetBlockTime() + nStakeSplitAge > txNew.nTime)
txNew.vout.push_back(CTxOut(0, scriptPubKeyOut)); //split stake
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : added kernel type=%d\n", whichType);
fKernelFound = true;
Expand Down Expand Up @@ -1556,7 +1555,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
if (pcoin.first->vout[pcoin.second].nValue > nCombineThreshold)
continue;
// Do not add input that is still too young
if (pcoin.first->nTime + nStakeMaxAge > txNew.nTime)
if (pcoin.first->nTime + nStakeCombineAge > txNew.nTime)
continue;
txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
Expand Down