aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJannis Froese <[email protected]>2014-03-22 08:44:58 +0100
committerJannis Froese <[email protected]>2014-03-22 22:13:28 +0100
commite68d56b2dbfbaa53f9be4c563654dea9c5226f97 (patch)
tree5040f8214edc1ff39b3ecd01d9002872bf6f675a /src/main.cpp
parentfix regtest network (diff)
downloaddiscoin-e68d56b2dbfbaa53f9be4c563654dea9c5226f97.tar.xz
discoin-e68d56b2dbfbaa53f9be4c563654dea9c5226f97.zip
additional Dogecoin 1.6 protocol change
(cherry picked from commit 650ec89e251e1201479d75f79ac520f278a50c40)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2cfe9a6e3..f90e87e32 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1206,10 +1206,17 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime)
bnResult.SetCompact(nBase);
while (nTime > 0 && bnResult < bnLimit)
{
- // Maximum 400% adjustment...
- bnResult *= 4;
- // ... in best-case exactly 4-times-normal target time
- nTime -= nTargetTimespan*4;
+ if(chainActive.Height()+1<nDiffChangeTarget){
+ // Maximum 400% adjustment...
+ bnResult *= 4;
+ // ... in best-case exactly 4-times-normal target time
+ nTime -= nTargetTimespan*4;
+ } else {
+ // Maximum 10% adjustment...
+ bnResult = (bnResult * 110) / 100;
+ // ... in best-case exactly 4-times-normal target time
+ nTime -= nTargetTimespanNEW*4;
+ }
}
if (bnResult > bnLimit)
bnResult = bnLimit;