Skip to content

Commit 22d8700

Browse files
committed
Merge #10311: Remove unused args from GetFetchFlags()
1ff2bb4 Remove unused args from GetFetchhFlags() (BtcDrak) Tree-SHA512: 75ed1076651f4e255720425386cbce0677c2e38c789a94cda95f51a8e5ed9cb7213f21a974c65539f256da9b91ccbc2fcc16b164815b46cd499b733becbddc57
2 parents 0912620 + 1ff2bb4 commit 22d8700

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/net_processing.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
11621162
}
11631163
}
11641164

1165-
uint32_t GetFetchFlags(CNode* pfrom, const CBlockIndex* pprev, const Consensus::Params& chainparams) {
1165+
uint32_t GetFetchFlags(CNode* pfrom) {
11661166
uint32_t nFetchFlags = 0;
11671167
if ((pfrom->GetLocalServices() & NODE_WITNESS) && State(pfrom->GetId())->fHaveWitness) {
11681168
nFetchFlags |= MSG_WITNESS_FLAG;
@@ -1550,7 +1550,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
15501550

15511551
LOCK(cs_main);
15521552

1553-
uint32_t nFetchFlags = GetFetchFlags(pfrom, chainActive.Tip(), chainparams.GetConsensus());
1553+
uint32_t nFetchFlags = GetFetchFlags(pfrom);
15541554

15551555
std::vector<CInv> vToFetch;
15561556

@@ -1903,7 +1903,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
19031903
}
19041904
}
19051905
if (!fRejectedParents) {
1906-
uint32_t nFetchFlags = GetFetchFlags(pfrom, chainActive.Tip(), chainparams.GetConsensus());
1906+
uint32_t nFetchFlags = GetFetchFlags(pfrom);
19071907
BOOST_FOREACH(const CTxIn& txin, tx.vin) {
19081908
CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash);
19091909
pfrom->AddInventoryKnown(_inv);
@@ -2040,7 +2040,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20402040
// We requested this block for some reason, but our mempool will probably be useless
20412041
// so we just grab the block via normal getdata
20422042
std::vector<CInv> vInv(1);
2043-
vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom, pindex->pprev, chainparams.GetConsensus()), cmpctblock.header.GetHash());
2043+
vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom), cmpctblock.header.GetHash());
20442044
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
20452045
}
20462046
return true;
@@ -2084,7 +2084,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20842084
} else if (status == READ_STATUS_FAILED) {
20852085
// Duplicate txindexes, the block is now in-flight, so just request it
20862086
std::vector<CInv> vInv(1);
2087-
vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom, pindex->pprev, chainparams.GetConsensus()), cmpctblock.header.GetHash());
2087+
vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom), cmpctblock.header.GetHash());
20882088
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
20892089
return true;
20902090
}
@@ -2127,7 +2127,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
21272127
// We requested this block, but its far into the future, so our
21282128
// mempool will probably be useless - request the block normally
21292129
std::vector<CInv> vInv(1);
2130-
vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom, pindex->pprev, chainparams.GetConsensus()), cmpctblock.header.GetHash());
2130+
vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom), cmpctblock.header.GetHash());
21312131
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
21322132
return true;
21332133
} else {
@@ -2198,7 +2198,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
21982198
} else if (status == READ_STATUS_FAILED) {
21992199
// Might have collided, fall back to getdata now :(
22002200
std::vector<CInv> invs;
2201-
invs.push_back(CInv(MSG_BLOCK | GetFetchFlags(pfrom, chainActive.Tip(), chainparams.GetConsensus()), resp.blockhash));
2201+
invs.push_back(CInv(MSG_BLOCK | GetFetchFlags(pfrom), resp.blockhash));
22022202
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, invs));
22032203
} else {
22042204
// Block is either okay, or possibly we received
@@ -2366,7 +2366,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
23662366
// Can't download any more from this peer
23672367
break;
23682368
}
2369-
uint32_t nFetchFlags = GetFetchFlags(pfrom, pindex->pprev, chainparams.GetConsensus());
2369+
uint32_t nFetchFlags = GetFetchFlags(pfrom);
23702370
vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash()));
23712371
MarkBlockAsInFlight(pfrom->GetId(), pindex->GetBlockHash(), chainparams.GetConsensus(), pindex);
23722372
LogPrint(BCLog::NET, "Requesting block %s from peer=%d\n",
@@ -3221,7 +3221,7 @@ bool SendMessages(CNode* pto, CConnman& connman, const std::atomic<bool>& interr
32213221
NodeId staller = -1;
32223222
FindNextBlocksToDownload(pto->GetId(), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight, vToDownload, staller, consensusParams);
32233223
BOOST_FOREACH(const CBlockIndex *pindex, vToDownload) {
3224-
uint32_t nFetchFlags = GetFetchFlags(pto, pindex->pprev, consensusParams);
3224+
uint32_t nFetchFlags = GetFetchFlags(pto);
32253225
vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash()));
32263226
MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), consensusParams, pindex);
32273227
LogPrint(BCLog::NET, "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(),

0 commit comments

Comments
 (0)