Move 'nTransactionFee' to wallet.cpp
[novacoin.git] / src / rpcblockchain.cpp
index 054dca2..e1ef171 100644 (file)
@@ -3,7 +3,7 @@
 // Distributed under the MIT/X11 software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
-#include "main.h"
+#include "wallet.h"
 #include "bitcoinrpc.h"
 #include <boost/filesystem.hpp>
 #include <boost/iostreams/device/file.hpp>
@@ -93,7 +93,7 @@ double GetPoSKernelPS()
         pindex = pindex->pprev;
     }
 
-    if (!nStakesHandled)
+    if (!nStakesHandled || nStakesTime == 0)
         return 0;
 
     return dStakeKernelsTriedAvg / nStakesTime;
@@ -128,7 +128,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPri
     result.push_back(Pair("modifier", strprintf("%016" PRIx64, blockindex->nStakeModifier)));
     result.push_back(Pair("modifierchecksum", strprintf("%08x", blockindex->nStakeModifierChecksum)));
     Array txinfo;
-    BOOST_FOREACH (const CTransaction& tx, block.vtx)
+    for(const auto& tx : block.vtx)
     {
         if (fPrintTransactionDetail)
         {
@@ -210,7 +210,7 @@ Value getrawmempool(const Array& params, bool fHelp)
     mempool.queryHashes(vtxid);
 
     Array a;
-    BOOST_FOREACH(const uint256& hash, vtxid)
+    for(const uint256& hash :  vtxid)
         a.push_back(hash.ToString());
 
     return a;
@@ -394,13 +394,13 @@ Value getcheckpoint(const Array& params, bool fHelp)
     }
 
     // Check that the block satisfies synchronized checkpoint
-    if (CheckpointsMode == Checkpoints::STRICT)
+    if (CheckpointsMode == Checkpoints::CP_STRICT)
         result.push_back(Pair("policy", "strict"));
 
-    if (CheckpointsMode == Checkpoints::ADVISORY)
+    if (CheckpointsMode == Checkpoints::CP_ADVISORY)
         result.push_back(Pair("policy", "advisory"));
 
-    if (CheckpointsMode == Checkpoints::PERMISSIVE)
+    if (CheckpointsMode == Checkpoints::CP_PERMISSIVE)
         result.push_back(Pair("policy", "permissive"));
 
     if (mapArgs.count("-checkpointkey"))