]> Git Repo - VerusCoin.git/commitdiff
Cleanup next work
authormiketout <[email protected]>
Sat, 15 Dec 2018 16:52:49 +0000 (08:52 -0800)
committermiketout <[email protected]>
Sat, 15 Dec 2018 16:52:49 +0000 (08:52 -0800)
src/miner.cpp
src/pow.cpp

index e580266f4e9abc03d09689af457563b36d084b77..825f503b7eb44453af4e226bf42a6ec51b7187f2 100644 (file)
@@ -1072,7 +1072,7 @@ void static VerusStaker(CWallet *pwallet)
             {
                 // wait to try another staking block until after the tip moves again
                 while ( chainActive.LastTip() == pindexPrev )
-                    sleep(1);
+                    MilliSleep(100);
                 continue;
             }
 
index 74d39409b2c29b6c907743e4225fdb7775eba396..ae4bd9195b43422f07250fef545a8c8f489816d6 100644 (file)
@@ -114,11 +114,13 @@ unsigned int lwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const
 {
     arith_uint256 nextTarget {0}, sumTarget {0}, bnTmp, bnLimit;
     if (ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH)
+    {
         bnLimit = UintToArith256(params.powLimit);
+    }
     else
+    {
         bnLimit = UintToArith256(params.powAlternate);
-
-    unsigned int nProofOfWorkLimit = bnLimit.GetCompact();
+    }
 
     // Find the first block in the averaging interval as we total the linearly weighted average
     const CBlockIndex* pindexFirst = pindexLast;
@@ -157,7 +159,7 @@ unsigned int lwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const
 
     // Check we have enough blocks
     if (!pindexFirst)
-        return nProofOfWorkLimit;
+        return bnLimit.GetCompact();
 
     // Keep t reasonable in case strange solvetimes occurred.
     if (t < N * k / 3)
@@ -175,7 +177,7 @@ bool DoesHashQualify(const CBlockIndex *pbindex)
 {
     // if it fails hash test and PoW validation, consider it POS. it could also be invalid
     arith_uint256 hash = UintToArith256(pbindex->GetBlockHash());
-    // to be considered POS, we first can't qualify as POW
+    // to be considered POS in Komodo POS, non VerusPoS, we first can't qualify as POW
     if (hash > hash.SetCompact(pbindex->nBits))
     {
         return false;
This page took 0.031198 seconds and 4 git commands to generate.