diff options
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/blockchain.cpp | 20 | ||||
-rw-r--r-- | src/rpc/mining.cpp | 2 | ||||
-rw-r--r-- | src/rpc/misc.cpp | 2 | ||||
-rw-r--r-- | src/rpc/net.cpp | 10 | ||||
-rw-r--r-- | src/rpc/rawtransaction.cpp | 8 | ||||
-rw-r--r-- | src/rpc/server.cpp | 6 |
6 files changed, 24 insertions, 24 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 388472f076..8f7f76841d 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -365,14 +365,14 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) info.push_back(Pair("ancestorfees", e.GetModFeesWithAncestors())); const CTransaction& tx = e.GetTx(); std::set<std::string> setDepends; - BOOST_FOREACH(const CTxIn& txin, tx.vin) + for (const CTxIn& txin : tx.vin) { if (mempool.exists(txin.prevout.hash)) setDepends.insert(txin.prevout.hash.ToString()); } UniValue depends(UniValue::VARR); - BOOST_FOREACH(const std::string& dep, setDepends) + for (const std::string& dep : setDepends) { depends.push_back(dep); } @@ -386,7 +386,7 @@ UniValue mempoolToJSON(bool fVerbose) { LOCK(mempool.cs); UniValue o(UniValue::VOBJ); - BOOST_FOREACH(const CTxMemPoolEntry& e, mempool.mapTx) + for (const CTxMemPoolEntry& e : mempool.mapTx) { const uint256& hash = e.GetTx().GetHash(); UniValue info(UniValue::VOBJ); @@ -401,7 +401,7 @@ UniValue mempoolToJSON(bool fVerbose) mempool.queryHashes(vtxid); UniValue a(UniValue::VARR); - BOOST_FOREACH(const uint256& hash, vtxid) + for (const uint256& hash : vtxid) a.push_back(hash.ToString()); return a; @@ -486,14 +486,14 @@ UniValue getmempoolancestors(const JSONRPCRequest& request) if (!fVerbose) { UniValue o(UniValue::VARR); - BOOST_FOREACH(CTxMemPool::txiter ancestorIt, setAncestors) { + for (CTxMemPool::txiter ancestorIt : setAncestors) { o.push_back(ancestorIt->GetTx().GetHash().ToString()); } return o; } else { UniValue o(UniValue::VOBJ); - BOOST_FOREACH(CTxMemPool::txiter ancestorIt, setAncestors) { + for (CTxMemPool::txiter ancestorIt : setAncestors) { const CTxMemPoolEntry &e = *ancestorIt; const uint256& _hash = e.GetTx().GetHash(); UniValue info(UniValue::VOBJ); @@ -550,14 +550,14 @@ UniValue getmempooldescendants(const JSONRPCRequest& request) if (!fVerbose) { UniValue o(UniValue::VARR); - BOOST_FOREACH(CTxMemPool::txiter descendantIt, setDescendants) { + for (CTxMemPool::txiter descendantIt : setDescendants) { o.push_back(descendantIt->GetTx().GetHash().ToString()); } return o; } else { UniValue o(UniValue::VOBJ); - BOOST_FOREACH(CTxMemPool::txiter descendantIt, setDescendants) { + for (CTxMemPool::txiter descendantIt : setDescendants) { const CTxMemPoolEntry &e = *descendantIt; const uint256& _hash = e.GetTx().GetHash(); UniValue info(UniValue::VOBJ); @@ -1262,7 +1262,7 @@ UniValue getchaintips(const JSONRPCRequest& request) std::set<const CBlockIndex*> setOrphans; std::set<const CBlockIndex*> setPrevs; - BOOST_FOREACH(const PAIRTYPE(const uint256, CBlockIndex*)& item, mapBlockIndex) + for (const std::pair<const uint256, CBlockIndex*>& item : mapBlockIndex) { if (!chainActive.Contains(item.second)) { setOrphans.insert(item.second); @@ -1282,7 +1282,7 @@ UniValue getchaintips(const JSONRPCRequest& request) /* Construct the output array. */ UniValue res(UniValue::VARR); - BOOST_FOREACH(const CBlockIndex* block, setTips) + for (const CBlockIndex* block : setTips) { UniValue obj(UniValue::VOBJ); obj.push_back(Pair("height", block->nHeight)); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index ab9f40d466..9af29652cf 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -582,7 +582,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request) entry.push_back(Pair("hash", tx.GetWitnessHash().GetHex())); UniValue deps(UniValue::VARR); - BOOST_FOREACH (const CTxIn &in, tx.vin) + for (const CTxIn &in : tx.vin) { if (setTxIndex.count(in.prevout.hash)) deps.push_back(setTxIndex[in.prevout.hash]); diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 5af6bbef33..ef19e481c2 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -147,7 +147,7 @@ public: obj.push_back(Pair("script", GetTxnOutputType(whichType))); obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end()))); UniValue a(UniValue::VARR); - BOOST_FOREACH(const CTxDestination& addr, addresses) + for (const CTxDestination& addr : addresses) a.push_back(CBitcoinAddress(addr).ToString()); obj.push_back(Pair("addresses", a)); if (whichType == TX_MULTISIG) diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 10bf99eb38..d6f9f0059c 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -126,7 +126,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request) UniValue ret(UniValue::VARR); - BOOST_FOREACH(const CNodeStats& stats, vstats) { + for (const CNodeStats& stats : vstats) { UniValue obj(UniValue::VOBJ); CNodeStateStats statestats; bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); @@ -163,7 +163,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request) obj.push_back(Pair("synced_headers", statestats.nSyncHeight)); obj.push_back(Pair("synced_blocks", statestats.nCommonHeight)); UniValue heights(UniValue::VARR); - BOOST_FOREACH(int height, statestats.vHeightInFlight) { + for (int height : statestats.vHeightInFlight) { heights.push_back(height); } obj.push_back(Pair("inflight", heights)); @@ -171,14 +171,14 @@ UniValue getpeerinfo(const JSONRPCRequest& request) obj.push_back(Pair("whitelisted", stats.fWhitelisted)); UniValue sendPerMsgCmd(UniValue::VOBJ); - BOOST_FOREACH(const mapMsgCmdSize::value_type &i, stats.mapSendBytesPerMsgCmd) { + for (const mapMsgCmdSize::value_type &i : stats.mapSendBytesPerMsgCmd) { if (i.second > 0) sendPerMsgCmd.push_back(Pair(i.first, i.second)); } obj.push_back(Pair("bytessent_per_msg", sendPerMsgCmd)); UniValue recvPerMsgCmd(UniValue::VOBJ); - BOOST_FOREACH(const mapMsgCmdSize::value_type &i, stats.mapRecvBytesPerMsgCmd) { + for (const mapMsgCmdSize::value_type &i : stats.mapRecvBytesPerMsgCmd) { if (i.second > 0) recvPerMsgCmd.push_back(Pair(i.first, i.second)); } @@ -474,7 +474,7 @@ UniValue getnetworkinfo(const JSONRPCRequest& request) UniValue localAddresses(UniValue::VARR); { LOCK(cs_mapLocalHost); - BOOST_FOREACH(const PAIRTYPE(CNetAddr, LocalServiceInfo) &item, mapLocalHost) + for (const std::pair<CNetAddr, LocalServiceInfo> &item : mapLocalHost) { UniValue rec(UniValue::VOBJ); rec.push_back(Pair("address", item.first.ToString())); diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 63fd197a6b..42f3762bf6 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -281,7 +281,7 @@ UniValue verifytxoutproof(const JSONRPCRequest& request) if (!mapBlockIndex.count(merkleBlock.header.GetHash()) || !chainActive.Contains(mapBlockIndex[merkleBlock.header.GetHash()])) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found in chain"); - BOOST_FOREACH(const uint256& hash, vMatch) + for (const uint256& hash : vMatch) res.push_back(hash.GetHex()); return res; } @@ -383,7 +383,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request) std::set<CBitcoinAddress> setAddress; std::vector<std::string> addrList = sendTo.getKeys(); - BOOST_FOREACH(const std::string& name_, addrList) { + for (const std::string& name_ : addrList) { if (name_ == "data") { std::vector<unsigned char> data = ParseHexV(sendTo[name_].getValStr(),"Data"); @@ -651,7 +651,7 @@ UniValue signrawtransaction(const JSONRPCRequest& request) CCoinsViewMemPool viewMempool(&viewChain, mempool); view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view - BOOST_FOREACH(const CTxIn& txin, mergedTx.vin) { + for (const CTxIn& txin : mergedTx.vin) { view.AccessCoin(txin.prevout); // Load entries from viewChain into view; can fail. } @@ -794,7 +794,7 @@ UniValue signrawtransaction(const JSONRPCRequest& request) ProduceSignature(MutableTransactionSignatureCreator(&keystore, &mergedTx, i, amount, nHashType), prevPubKey, sigdata); // ... and merge in other signatures: - BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { + for (const CMutableTransaction& txv : txVariants) { if (txv.vin.size() > i) { sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(txv, i)); } diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 31771dffb8..1a04ce2b47 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -62,7 +62,7 @@ void RPCTypeCheck(const UniValue& params, bool fAllowNull) { unsigned int i = 0; - BOOST_FOREACH(UniValue::VType t, typesExpected) + for (UniValue::VType t : typesExpected) { if (params.size() <= i) break; @@ -101,7 +101,7 @@ void RPCTypeCheckObj(const UniValue& o, if (fStrict) { - BOOST_FOREACH(const std::string& k, o.getKeys()) + for (const std::string& k : o.getKeys()) { if (typesExpected.count(k) == 0) { @@ -184,7 +184,7 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& jreq.fHelp = true; jreq.params = UniValue(); - BOOST_FOREACH(const PAIRTYPE(std::string, const CRPCCommand*)& command, vCommands) + for (const std::pair<std::string, const CRPCCommand*>& command : vCommands) { const CRPCCommand *pcmd = command.second; std::string strMethod = pcmd->name; |