Use CBigNum for temporary variables to prevent overflow. Which is unlikely to happen...
[novacoin.git] / src / miner.cpp
index dd75386..55e4fec 100644 (file)
@@ -107,7 +107,7 @@ CBlock* CreateNewBlock(CWallet* pwallet, CTransaction *txCoinStake)
     bool fProofOfStake = txCoinStake != NULL;
 
     // Create new block
-    auto_ptr<CBlock> pblock(new CBlock());
+    unique_ptr<CBlock> pblock(new CBlock());
     if (!pblock.get())
         return NULL;
 
@@ -159,8 +159,11 @@ CBlock* CreateNewBlock(CWallet* pwallet, CTransaction *txCoinStake)
     // 1-satoshi-fee transactions. It should be set above the real
     // cost to you of processing a transaction.
     auto nMinTxFee = MIN_TX_FEE;
-    if (mapArgs.count("-mintxfee"))
-        ParseMoney(mapArgs["-mintxfee"], nMinTxFee);
+    if (mapArgs.count("-mintxfee")) {
+        bool fResult = ParseMoney(mapArgs["-mintxfee"], nMinTxFee);
+        if (!fResult) // Parse error
+            nMinTxFee = MIN_TX_FEE;
+    }
 
     auto pindexPrev = pindexBest;