Merge pull request #347 from svost/c++11
authorCryptoManiac <CryptoManiac@users.noreply.github.com>
Mon, 9 May 2016 04:31:29 +0000 (08:31 +0400)
committerCryptoManiac <CryptoManiac@users.noreply.github.com>
Mon, 9 May 2016 04:31:29 +0000 (08:31 +0400)
Minor fix

src/main.cpp
src/rpcblockchain.cpp

index 48de169..98c2105 100644 (file)
@@ -2677,7 +2677,10 @@ FILE* AppendBlockFile(unsigned int& nFileRet)
         if (!file)
             return NULL;
         if (fseek(file, 0, SEEK_END) != 0)
+        {
+            fclose(file);
             return NULL;
+        }
         // FAT32 file size max 4GB, fseek and ftell max 2GB, so we must stay under 2GB
         if (ftell(file) < (long)(0x7F000000 - MAX_SIZE))
         {
index 4561041..bf0fda2 100644 (file)
@@ -93,7 +93,7 @@ double GetPoSKernelPS()
         pindex = pindex->pprev;
     }
 
-    if (!nStakesHandled)
+    if (!nStakesHandled || nStakesTime == 0)
         return 0;
 
     return dStakeKernelsTriedAvg / nStakesTime;