mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Merge #10502: scripted-diff: Remove BOOST_FOREACH, Q_FOREACH and PAIRTYPE
1238f13cfscripted-diff: Remove PAIRTYPE (Jorge Timón)18dc3c396scripted-diff: Remove Q_FOREACH (Jorge Timón)7c00c2672scripted-diff: Fully remove BOOST_FOREACH (Jorge Timón)a5410ac5eSmall preparations for Q_FOREACH, PAIRTYPE and #include <boost/foreach.hpp> removal (Jorge Timón) Tree-SHA512: d3ab4a173366402e7dcef31608977b757d4aa07abbbad2ee1bcbcfa311e994a4552f24e5a55272cb22c2dcf89a4b0495e02e9d9aceae4b08c0bab668f20e324c
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user