if (tx.nTime > GetAdjustedTime() || (fProofOfStake && tx.nTime > pblock->vtx[0].nTime))
continue;
- // Simplify transaction fee - allow free = false
- int64 nMinFee = tx.GetMinFee(nBlockSize, false, GMF_BLOCK);
+ int64 nMinFee = tx.GetMinFee(nBlockSize, true, GMF_BLOCK, nTxSize);
// Skip free transactions if we're past the minimum block size:
if (fSortedByFee && (dFeePerKb < nMinTxFee) && (nBlockSize + nTxSize >= nBlockMinSize))
if (!tx.UpdateCoins(viewTemp, txundo, pindexPrev->nHeight+1, pblock->nTime))
continue;
+*/
+
// push changes from the second layer cache to the first one
viewTemp.Flush();
-*/
+ uint256 hash = tx.GetHash();
+
// Added
pblock->vtx.push_back(tx);
nBlockSize += nTxSize;
}
// Add transactions that depend on this one to the priority queue
- uint256 hash = tx.GetHash();
if (mapDependers.count(hash))
{
BOOST_FOREACH(COrphan* porphan, mapDependers[hash])
printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize);
if (!fProofOfStake)
- pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pblock->nBits);
+ {
+ bool fProtocol048 = fTestNet || VALIDATION_SWITCH_TIME < pblock->nTime;
+ pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pblock->nBits, fProtocol048 ? nFees : 0);
+ }
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
}
++nExtraNonce;
- unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
+ unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required
pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
{
uint256 proofHash = 0, hashTarget = 0;
uint256 hashBlock = pblock->GetHash();
+ bool fFatal = false;
if(!pblock->IsProofOfStake())
return error("CheckStake() : %s is not a proof-of-stake block", hashBlock.GetHex().c_str());
// verify hash target and signature of coinstake tx
- if (!CheckProofOfStake(pblock->vtx[1], pblock->nBits, proofHash, hashTarget))
+ if (!CheckProofOfStake(pblock->vtx[1], pblock->nBits, proofHash, hashTarget, fFatal, true))
return error("CheckStake() : proof-of-stake checking failed");
//// debug print
}
else
Sleep(nMinerSleep);
-
- continue;
}
}