@@ -1162,7 +1162,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
1162
1162
}
1163
1163
}
1164
1164
1165
- uint32_t GetFetchFlags (CNode* pfrom, const CBlockIndex* pprev, const Consensus::Params& chainparams ) {
1165
+ uint32_t GetFetchFlags (CNode* pfrom) {
1166
1166
uint32_t nFetchFlags = 0 ;
1167
1167
if ((pfrom->GetLocalServices () & NODE_WITNESS) && State (pfrom->GetId ())->fHaveWitness ) {
1168
1168
nFetchFlags |= MSG_WITNESS_FLAG;
@@ -1550,7 +1550,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
1550
1550
1551
1551
LOCK (cs_main);
1552
1552
1553
- uint32_t nFetchFlags = GetFetchFlags (pfrom, chainActive. Tip (), chainparams. GetConsensus () );
1553
+ uint32_t nFetchFlags = GetFetchFlags (pfrom);
1554
1554
1555
1555
std::vector<CInv> vToFetch;
1556
1556
@@ -1903,7 +1903,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
1903
1903
}
1904
1904
}
1905
1905
if (!fRejectedParents ) {
1906
- uint32_t nFetchFlags = GetFetchFlags (pfrom, chainActive. Tip (), chainparams. GetConsensus () );
1906
+ uint32_t nFetchFlags = GetFetchFlags (pfrom);
1907
1907
BOOST_FOREACH (const CTxIn& txin, tx.vin ) {
1908
1908
CInv _inv (MSG_TX | nFetchFlags, txin.prevout .hash );
1909
1909
pfrom->AddInventoryKnown (_inv);
@@ -2040,7 +2040,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2040
2040
// We requested this block for some reason, but our mempool will probably be useless
2041
2041
// so we just grab the block via normal getdata
2042
2042
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 ());
2044
2044
connman.PushMessage (pfrom, msgMaker.Make (NetMsgType::GETDATA, vInv));
2045
2045
}
2046
2046
return true ;
@@ -2084,7 +2084,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2084
2084
} else if (status == READ_STATUS_FAILED) {
2085
2085
// Duplicate txindexes, the block is now in-flight, so just request it
2086
2086
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 ());
2088
2088
connman.PushMessage (pfrom, msgMaker.Make (NetMsgType::GETDATA, vInv));
2089
2089
return true ;
2090
2090
}
@@ -2127,7 +2127,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2127
2127
// We requested this block, but its far into the future, so our
2128
2128
// mempool will probably be useless - request the block normally
2129
2129
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 ());
2131
2131
connman.PushMessage (pfrom, msgMaker.Make (NetMsgType::GETDATA, vInv));
2132
2132
return true ;
2133
2133
} else {
@@ -2198,7 +2198,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2198
2198
} else if (status == READ_STATUS_FAILED) {
2199
2199
// Might have collided, fall back to getdata now :(
2200
2200
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 ));
2202
2202
connman.PushMessage (pfrom, msgMaker.Make (NetMsgType::GETDATA, invs));
2203
2203
} else {
2204
2204
// Block is either okay, or possibly we received
@@ -2366,7 +2366,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2366
2366
// Can't download any more from this peer
2367
2367
break ;
2368
2368
}
2369
- uint32_t nFetchFlags = GetFetchFlags (pfrom, pindex-> pprev , chainparams. GetConsensus () );
2369
+ uint32_t nFetchFlags = GetFetchFlags (pfrom);
2370
2370
vGetData.push_back (CInv (MSG_BLOCK | nFetchFlags, pindex->GetBlockHash ()));
2371
2371
MarkBlockAsInFlight (pfrom->GetId (), pindex->GetBlockHash (), chainparams.GetConsensus (), pindex);
2372
2372
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
3221
3221
NodeId staller = -1 ;
3222
3222
FindNextBlocksToDownload (pto->GetId (), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight , vToDownload, staller, consensusParams);
3223
3223
BOOST_FOREACH (const CBlockIndex *pindex, vToDownload) {
3224
- uint32_t nFetchFlags = GetFetchFlags (pto, pindex-> pprev , consensusParams );
3224
+ uint32_t nFetchFlags = GetFetchFlags (pto);
3225
3225
vGetData.push_back (CInv (MSG_BLOCK | nFetchFlags, pindex->GetBlockHash ()));
3226
3226
MarkBlockAsInFlight (pto->GetId (), pindex->GetBlockHash (), consensusParams, pindex);
3227
3227
LogPrint (BCLog::NET, " Requesting block %s (%d) peer=%d\n " , pindex->GetBlockHash ().ToString (),
0 commit comments