diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1351,12 +1351,6 @@ } } -uint32_t GetFetchFlags(CNode *pfrom, const CBlockIndex *pprev, - const Consensus::Params &chainparams) { - uint32_t nFetchFlags = 0; - return nFetchFlags; -} - inline static void SendBlockTransactions(const CBlock &block, const BlockTransactionsRequest &req, CNode *pfrom, CConnman &connman) { @@ -1768,9 +1762,6 @@ LOCK(cs_main); - uint32_t nFetchFlags = - GetFetchFlags(pfrom, chainActive.Tip(), chainparams.GetConsensus()); - std::vector vToFetch; for (size_t nInv = 0; nInv < vInv.size(); nInv++) { @@ -1784,10 +1775,6 @@ LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom->id); - if (inv.type == MSG_TX) { - inv.type |= nFetchFlags; - } - if (inv.type == MSG_BLOCK) { UpdateBlockAvailability(pfrom->GetId(), inv.hash); if (!fAlreadyHave && !fImporting && !fReindex && @@ -2160,10 +2147,9 @@ } } if (!fRejectedParents) { - uint32_t nFetchFlags = GetFetchFlags( - pfrom, chainActive.Tip(), chainparams.GetConsensus()); for (const CTxIn &txin : tx.vin) { - CInv _inv(MSG_TX | nFetchFlags, txin.prevout.GetTxId()); + // FIXME: MSG_TX should use a TxHash, not a TxId. + CInv _inv(MSG_TX, txin.prevout.GetTxId()); pfrom->AddInventoryKnown(_inv); if (!AlreadyHave(_inv)) { pfrom->AskFor(_inv); @@ -2333,10 +2319,7 @@ // will probably be useless so we just grab the block via // normal getdata. std::vector vInv(1); - vInv[0] = CInv( - MSG_BLOCK | GetFetchFlags(pfrom, pindex->pprev, - chainparams.GetConsensus()), - cmpctblock.header.GetHash()); + vInv[0] = CInv(MSG_BLOCK, cmpctblock.header.GetHash()); connman.PushMessage( pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv)); } @@ -2394,11 +2377,7 @@ // Duplicate txindices, the block is now in-flight, so // just request it. std::vector vInv(1); - vInv[0] = - CInv(MSG_BLOCK | - GetFetchFlags(pfrom, pindex->pprev, - chainparams.GetConsensus()), - cmpctblock.header.GetHash()); + vInv[0] = CInv(MSG_BLOCK, cmpctblock.header.GetHash()); connman.PushMessage( pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv)); return true; @@ -2446,10 +2425,7 @@ // our mempool will probably be useless - request the block // normally. std::vector vInv(1); - vInv[0] = CInv( - MSG_BLOCK | GetFetchFlags(pfrom, pindex->pprev, - chainparams.GetConsensus()), - cmpctblock.header.GetHash()); + vInv[0] = CInv(MSG_BLOCK, cmpctblock.header.GetHash()); connman.PushMessage( pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv)); return true; @@ -2543,10 +2519,7 @@ } else if (status == READ_STATUS_FAILED) { // Might have collided, fall back to getdata now :( std::vector invs; - invs.push_back( - CInv(MSG_BLOCK | GetFetchFlags(pfrom, chainActive.Tip(), - chainparams.GetConsensus()), - resp.blockhash)); + invs.push_back(CInv(MSG_BLOCK, resp.blockhash)); connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, invs)); } else { @@ -2754,10 +2727,8 @@ // Can't download any more from this peer break; } - uint32_t nFetchFlags = GetFetchFlags( - pfrom, pindex->pprev, chainparams.GetConsensus()); - vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, - pindex->GetBlockHash())); + vGetData.push_back( + CInv(MSG_BLOCK, pindex->GetBlockHash())); MarkBlockAsInFlight(config, pfrom->GetId(), pindex->GetBlockHash(), chainparams.GetConsensus(), pindex); @@ -3732,10 +3703,7 @@ state.nBlocksInFlight, vToDownload, staller, consensusParams); for (const CBlockIndex *pindex : vToDownload) { - uint32_t nFetchFlags = - GetFetchFlags(pto, pindex->pprev, consensusParams); - vGetData.push_back( - CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash())); + vGetData.push_back(CInv(MSG_BLOCK, pindex->GetBlockHash())); MarkBlockAsInFlight(config, pto->GetId(), pindex->GetBlockHash(), consensusParams, pindex); LogPrint(BCLog::NET, "Requesting block %s (%d) peer=%d\n",