int64 nFees = 0;
{
LOCK2(cs_main, mempool.cs);
- CCoinsDB coinsdb("r");
- CCoinsViewDB viewdb(coinsdb);
- CCoinsViewCache view(viewdb);
+ CCoinsViewCache view(*pcoinsTip, true);
// Priority order to process transactions
list<COrphan> vOrphan; // list memory doesn't move
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
+/*
+ * We need to call UpdateCoins using actual block timestamp, so don't perform this here.
+ *
CTxUndo txundo;
if (!tx.UpdateCoins(viewTemp, txundo, pindexPrev->nHeight+1, pblock->nTime))
continue;
// push changes from the second layer cache to the first one
viewTemp.Flush();
-
+*/
// Added
pblock->vtx.push_back(tx);
nBlockSize += nTxSize;
}
++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);
}
else
Sleep(nMinerSleep);
-
- continue;
}
}