Rename BitcoinMiner() function to StakeMiner(), remove some regacy code.
authoralex <alex@alex-VirtualBox.(none)>
Thu, 22 Aug 2013 19:23:08 +0000 (23:23 +0400)
committeralex <alex@alex-VirtualBox.(none)>
Thu, 22 Aug 2013 19:23:08 +0000 (23:23 +0400)
src/main.cpp
src/main.h
src/net.cpp

index 0801f2b..20f499d 100644 (file)
@@ -4542,17 +4542,17 @@ bool CheckStake(CBlock* pblock, CWallet& wallet)
     return true;
 }
 
-void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
+void StakeMiner(CWallet *pwallet)
 {
     SetThreadPriority(THREAD_PRIORITY_LOWEST);
 
     // Make this thread recognisable as the mining thread
-    RenameThread("bitcoin-miner");
+    RenameThread("novacoin-miner");
 
     // Each thread has its own counter
     unsigned int nExtraNonce = 0;
 
-    while (fProofOfStake)
+    while (true)
     {
         if (fShutdown)
             return;
@@ -4561,8 +4561,6 @@ void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
             Sleep(1000);
             if (fShutdown)
                 return;
-            if (!fProofOfStake)
-                return;
         }
 
         while (pwallet->IsLocked())
@@ -4577,7 +4575,7 @@ void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
         //
         CBlockIndex* pindexPrev = pindexBest;
 
-        auto_ptr<CBlock> pblock(CreateNewBlock(pwallet, fProofOfStake));
+        auto_ptr<CBlock> pblock(CreateNewBlock(pwallet, true));
         if (!pblock.get())
             return;
         IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce);
index d6eb8cf..4b36ac4 100644 (file)
@@ -129,7 +129,7 @@ std::string GetWarnings(std::string strFor);
 bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock);
 uint256 WantedByOrphan(const CBlock* pblockOrphan);
 const CBlockIndex* GetLastBlockIndex(const CBlockIndex* pindex, bool fProofOfStake);
-void BitcoinMiner(CWallet *pwallet, bool fProofOfStake);
+void StakeMiner(CWallet *pwallet);
 void ResendWalletTransactions();
 
 
index bde3e0f..455ab12 100644 (file)
@@ -1309,7 +1309,7 @@ void static ThreadStakeMinter(void* parg)
     try
     {
         vnThreadsRunning[THREAD_MINTER]++;
-        BitcoinMiner(pwallet, true);
+        StakeMiner(pwallet);
         vnThreadsRunning[THREAD_MINTER]--;
     }
     catch (std::exception& e) {