Bugfix: Use timestamp in coinbase rather than "bits", needed to ensure coinbase txn is unique even if address is the same

This commit is contained in:
Luke Dashjr
2011-09-06 16:39:05 -04:00
parent 49c8e53ee2
commit 83f4cd156e
3 changed files with 8 additions and 10 deletions

View File

@@ -1615,15 +1615,14 @@ Value getwork(const Array& params, bool fHelp)
vNewBlock.push_back(pblock);
}
// Update nExtraNonce
static unsigned int nExtraNonce = 0;
static int64 nPrevTime = 0;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce, nPrevTime);
// Update nTime
pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
pblock->nNonce = 0;
// Update nExtraNonce
static unsigned int nExtraNonce = 0;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
// Save
mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);