aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-07-29 15:34:48 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-07-29 15:34:48 +0000
commit17b2740289268c037c5adb5956989f134982bf80 (patch)
treea78b4cf9baef3ed88f7aca398831260bebcdd5d0 /main.cpp
parentf6f8237a748e3627bd4a201ed2e376d8c42c3bac (diff)
Fredrik Roubert: simplified makefile.unix with wx-config,
misc git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@118 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index 9c9e8662d0..ddc359af80 100644
--- a/main.cpp
+++ b/main.cpp
@@ -806,9 +806,9 @@ int64 CBlock::GetBlockValue(int64 nFees) const
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
{
- const unsigned int nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
- const unsigned int nTargetSpacing = 10 * 60;
- const unsigned int nInterval = nTargetTimespan / nTargetSpacing;
+ const int64 nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
+ const int64 nTargetSpacing = 10 * 60;
+ const int64 nInterval = nTargetTimespan / nTargetSpacing;
// Genesis block
if (pindexLast == NULL)
@@ -825,8 +825,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
assert(pindexFirst);
// Limit adjustment step
- unsigned int nActualTimespan = pindexLast->nTime - pindexFirst->nTime;
- printf(" nActualTimespan = %d before bounds\n", nActualTimespan);
+ int64 nActualTimespan = (int64)pindexLast->nTime - (int64)pindexFirst->nTime;
+ printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
if (nActualTimespan < nTargetTimespan/4)
nActualTimespan = nTargetTimespan/4;
if (nActualTimespan > nTargetTimespan*4)
@@ -843,7 +843,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
/// debug print
printf("GetNextWorkRequired RETARGET\n");
- printf("nTargetTimespan = %d nActualTimespan = %d\n", nTargetTimespan, nActualTimespan);
+ printf("nTargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", nTargetTimespan, nActualTimespan);
printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());