Skip to content

Commit

Permalink
No need to reservekey for sake
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed May 23, 2014
1 parent 2b42a3a commit 98c1867
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3994,8 +3994,6 @@ class TxPriorityCompare
// fProofOfStake: try (best effort) to make a proof-of-stake block
CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake)
{
CReserveKey reservekey(pwallet);

// Create new block
auto_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())
Expand All @@ -4006,7 +4004,14 @@ CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake)
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
txNew.vout[0].scriptPubKey << reservekey.GetReservedKey() << OP_CHECKSIG;

if (!fProofOfStake)
{
CReserveKey reservekey(pwallet);
txNew.vout[0].scriptPubKey << reservekey.GetReservedKey() << OP_CHECKSIG;
}
else
txNew.vout[0].SetEmpty();

// Add our coinbase tx as first transaction
pblock->vtx.push_back(txNew);
Expand Down Expand Up @@ -4051,7 +4056,6 @@ CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake)
if (txCoinStake.nTime >= max(pindexPrev->GetMedianTimePast()+1, pindexPrev->GetBlockTime() - nMaxClockDrift))
{ // make sure coinstake would meet timestamp protocol
// as it would be the same as the block timestamp
pblock->vtx[0].vout[0].SetEmpty();
pblock->vtx[0].nTime = txCoinStake.nTime;
pblock->vtx.push_back(txCoinStake);
}
Expand Down

0 comments on commit 98c1867

Please sign in to comment.