aboutsummaryrefslogtreecommitdiff
path: root/src/rpc.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2011-09-06 16:39:05 -0400
committerLuke Dashjr <luke-jr+git@utopios.org>2011-09-06 16:43:40 -0400
commit83f4cd156e9d52bd7c4351336dfa4806a43ee4e4 (patch)
treef4e2cd9e0f8be15977e3e2e9a224719fd195f8f1 /src/rpc.cpp
parent49c8e53ee2c2705fd0a8731458cb776dad7e1f6e (diff)
downloadbitcoin-83f4cd156e9d52bd7c4351336dfa4806a43ee4e4.tar.xz
Bugfix: Use timestamp in coinbase rather than "bits", needed to ensure coinbase txn is unique even if address is the same
Diffstat (limited to 'src/rpc.cpp')
-rw-r--r--src/rpc.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rpc.cpp b/src/rpc.cpp
index 2a458423ce..33cfa77b40 100644
--- a/src/rpc.cpp
+++ b/src/rpc.cpp
@@ -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);