Remove boost foreach macro
[novacoin.git] / src / rpcmining.cpp
index ce6545b..ca56968 100644 (file)
@@ -133,7 +133,7 @@ Value scaninput(const Array& params, bool fHelp)
         if (inputs_v.type() == array_type)
         {
             Array inputs = inputs_v.get_array();
-            BOOST_FOREACH(const Value &v_out, inputs)
+            for (const Value &v_out : inputs)
             {
                 int nOut = v_out.get_int();
                 if (nOut < 0 || nOut > (int)tx.vout.size() - 1)
@@ -188,7 +188,7 @@ Value scaninput(const Array& params, bool fHelp)
         interval.second = interval.first + nDays * nOneDay;
 
         Array results;
-        BOOST_FOREACH(const int &nOut, vInputs)
+        for (const int &nOut : vInputs)
         {
             // Check for spent flag
             // It doesn't make sense to scan spent inputs.
@@ -208,7 +208,7 @@ Value scaninput(const Array& params, bool fHelp)
             std::vector<std::pair<uint256, uint32_t> > result;
             if (ScanKernelForward((unsigned char *)&itK[0], nBits, tx.nTime, tx.vout[nOut].nValue, interval, result))
             {
-                BOOST_FOREACH(const PAIRTYPE(uint256, uint32_t) solution, result)
+                for (const auto &solution : result)
                 {
                     Object item;
                     item.push_back(Pair("nout", nOut));
@@ -307,7 +307,7 @@ Value getworkex(const Array& params, bool fHelp)
 
         Array merkle_arr;
 
-        BOOST_FOREACH(uint256 merkleh, merkle) {
+        for (uint256 merkleh : merkle) {
             merkle_arr.push_back(HexStr(BEGIN(merkleh), END(merkleh)));
         }
 
@@ -550,7 +550,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
     map<uint256, int64_t> setTxIndex;
     int i = 0;
     CTxDB txdb("r");
-    BOOST_FOREACH (CTransaction& tx, pblock->vtx)
+    for (CTransaction& tx : pblock->vtx)
     {
         uint256 txHash = tx.GetHash();
         setTxIndex[txHash] = i++;
@@ -574,7 +574,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
             entry.push_back(Pair("fee", (int64_t)(tx.GetValueIn(mapInputs) - tx.GetValueOut())));
 
             Array deps;
-            BOOST_FOREACH (MapPrevTx::value_type& inp, mapInputs)
+            for (MapPrevTx::value_type& inp : mapInputs)
             {
                 if (setTxIndex.count(inp.first))
                     deps.push_back(setTxIndex[inp.first]);