Skip to content

Commit 335798c

Browse files
committed
Merge bitcoin/bitcoin#31397: p2p: track and use all potential peers for orphan resolution
86d7135 [p2p] only attempt 1p1c when both txns provided by the same peer (glozow) f7658d9 [cleanup] remove p2p_inv from AddTxAnnouncement (glozow) 063c132 [functional test] getorphantxs reflects multiple announcers (glozow) 0da693f [functional test] orphan handling with multiple announcers (glozow) b6ea4a9 [p2p] try multiple peers for orphan resolution (glozow) 1d2e1d7 [refactor] move creation of unique_parents to helper function (glozow) c6893b0 [txdownload] remove unique_parents that we already have (glozow) 163aaf2 [fuzz] orphanage multiple announcer functions (glozow) 22b023b [unit test] multiple orphan announcers (glozow) 96c1a82 [unit test] TxOrphanage EraseForBlock (glozow) 04448ce [txorphanage] add GetTx so that orphan vin can be read (glozow) e810842 [txorphanage] support multiple announcers (glozow) 62a9ff1 [refactor] change type of unique_parents to Txid (glozow) 6951ddc [txrequest] GetCandidatePeers (glozow) Pull request description: Part of #27463. (Transaction) **orphan resolution** is a process that kicks off when we are missing UTXOs to validate an unconfirmed transaction. We currently request missing parents by txid; BIP 331 also defines a way to [explicitly request ancestors](https://github.com/bitcoin/bips/blob/master/bip-0331.mediawiki#handle-orphans-better). Currently, when we find that a transaction is an orphan, we only try to resolve it with the peer who provided the `tx`. If this doesn't work out (e.g. they send a `notfound` or don't respond), we do not try again. We actually can't, because we've already forgotten who else could resolve this orphan (i.e. all the other peers who announced the transaction). What is wrong with this? It makes transaction download less reliable, particularly for 1p1c packages which must go through orphan resolution in order to be downloaded. Can we fix this with BIP 331 / is this "duct tape" before the real solution? BIP 331 (receiver-initiated ancestor package relay) is also based on the idea that there is an orphan that needs resolution, but it's just a new way of communicating information. It's not inherently more honest; you can request ancestor package information and get a `notfound`. So ancestor package relay still requires some kind of procedure for retrying when an orphan resolution attempt fails. See the #27742 implementation which builds on this orphan resolution tracker to keep track of what packages to download (it just isn't rebased on this exact branch). The difference when using BIP 331 is that we request `ancpkginfo` and then `pkgtxns` instead of the parent txids. Zooming out, we'd like orphan handling to be: - Bandwidth-efficient: don't have too many requests out at once. As already implemented today, transaction requests for orphan parents and regular download both go through the `TxRequestTracker` so that we don't have duplicate requests out. - Not vulnerable to censorship: don't give up too easily, use all candidate peers. See e.g. https://bitcoincore.org/en/2024/07/03/disclose_already_asked_for/ - Load-balance between peers: don't overload peers; use all peers available. This is also useful for when we introduce per-peer orphan protection, since each peer will have limited slots. The approach taken in this PR is to think of each peer who announces an orphan as a potential "orphan resolution candidate." These candidates include: - the peer who sent us the orphan tx - any peers who announced the orphan prior to us downloading it - any peers who subsequently announce the orphan after we have started trying to resolve it For each orphan resolution candidate, we treat them as having "announced" all of the missing parents to us at the time of receipt of this orphan transaction (or at the time they announced the tx if they do so after we've already started tracking it as an orphan). We add the missing parents as entries to `m_txrequest`, incorporating the logic of typical txrequest processing, which means we prefer outbounds, try not to have duplicate requests in flight, don't overload peers, etc. ACKs for top commit: marcofleon: Code review ACK 86d7135 instagibbs: reACK 86d7135 dergoegge: Code review ACK 86d7135 mzumsande: ACK 86d7135 Tree-SHA512: 618d523b86e60c3ea039e88326d50db4e55e8e18309c6a20e8f2b10ed9e076f1de0315c335fd3b8abdabcc8b53cbceb66fb59147d05470ea25b83a2b4bd9c877
2 parents 98939ce + 86d7135 commit 335798c

18 files changed

+638
-174
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ std::optional<node::PackageToValidate> PeerManagerImpl::ProcessInvalidTx(NodeId
29782978
if (add_extra_compact_tx && RecursiveDynamicUsage(*ptx) < 100000) {
29792979
AddToCompactExtraTransactions(ptx);
29802980
}
2981-
for (const uint256& parent_txid : unique_parents) {
2981+
for (const Txid& parent_txid : unique_parents) {
29822982
if (peer) AddKnownTx(*peer, parent_txid);
29832983
}
29842984

@@ -3934,7 +3934,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
39343934
AddKnownTx(*peer, inv.hash);
39353935

39363936
if (!m_chainman.IsInitialBlockDownload()) {
3937-
const bool fAlreadyHave{m_txdownloadman.AddTxAnnouncement(pfrom.GetId(), gtxid, current_time, /*p2p_inv=*/true)};
3937+
const bool fAlreadyHave{m_txdownloadman.AddTxAnnouncement(pfrom.GetId(), gtxid, current_time)};
39383938
LogDebug(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
39393939
}
39403940
} else {

src/node/txdownloadman.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct PackageToValidate {
9292
struct RejectedTxTodo
9393
{
9494
bool m_should_add_extra_compact_tx;
95-
std::vector<uint256> m_unique_parents;
95+
std::vector<Txid> m_unique_parents;
9696
std::optional<PackageToValidate> m_package_to_validate;
9797
};
9898

@@ -136,9 +136,8 @@ class TxDownloadManager {
136136

137137
/** Consider adding this tx hash to txrequest. Should be called whenever a new inv has been received.
138138
* Also called internally when a transaction is missing parents so that we can request them.
139-
* @param[in] p2p_inv When true, only add this announcement if we don't already have the tx.
140139
* Returns true if this was a dropped inv (p2p_inv=true and we already have the tx), false otherwise. */
141-
bool AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv);
140+
bool AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now);
142141

143142
/** Get getdata requests to send. */
144143
std::vector<GenTxid> GetRequestsToSend(NodeId nodeid, std::chrono::microseconds current_time);

src/node/txdownloadman_impl.cpp

Lines changed: 118 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ void TxDownloadManager::DisconnectedPeer(NodeId nodeid)
3939
{
4040
m_impl->DisconnectedPeer(nodeid);
4141
}
42-
bool TxDownloadManager::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv)
42+
bool TxDownloadManager::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now)
4343
{
44-
return m_impl->AddTxAnnouncement(peer, gtxid, now, p2p_inv);
44+
return m_impl->AddTxAnnouncement(peer, gtxid, now);
4545
}
4646
std::vector<GenTxid> TxDownloadManager::GetRequestsToSend(NodeId nodeid, std::chrono::microseconds current_time)
4747
{
@@ -172,12 +172,39 @@ void TxDownloadManagerImpl::DisconnectedPeer(NodeId nodeid)
172172

173173
}
174174

175-
bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv)
175+
bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now)
176176
{
177+
// If this is an orphan we are trying to resolve, consider this peer as a orphan resolution candidate instead.
178+
// - is wtxid matching something in orphanage
179+
// - exists in orphanage
180+
// - peer can be an orphan resolution candidate
181+
if (gtxid.IsWtxid()) {
182+
if (auto orphan_tx{m_orphanage.GetTx(Wtxid::FromUint256(gtxid.GetHash()))}) {
183+
auto unique_parents{GetUniqueParents(*orphan_tx)};
184+
std::erase_if(unique_parents, [&](const auto& txid){
185+
return AlreadyHaveTx(GenTxid::Txid(txid), /*include_reconsiderable=*/false);
186+
});
187+
188+
if (unique_parents.empty()) return true;
189+
190+
if (auto delay{OrphanResolutionCandidate(peer, Wtxid::FromUint256(gtxid.GetHash()), unique_parents.size())}) {
191+
m_orphanage.AddAnnouncer(Wtxid::FromUint256(gtxid.GetHash()), peer);
192+
193+
const auto& info = m_peer_info.at(peer).m_connection_info;
194+
for (const auto& parent_txid : unique_parents) {
195+
m_txrequest.ReceivedInv(peer, GenTxid::Txid(parent_txid), info.m_preferred, now + *delay);
196+
}
197+
198+
LogDebug(BCLog::TXPACKAGES, "added peer=%d as a candidate for resolving orphan %s\n", peer, gtxid.GetHash().ToString());
199+
}
200+
201+
// Return even if the peer isn't an orphan resolution candidate. This would be caught by AlreadyHaveTx.
202+
return true;
203+
}
204+
}
205+
177206
// If this is an inv received from a peer and we already have it, we can drop it.
178-
// If this is a request for the parent of an orphan, we don't drop transactions that we already have. In particular,
179-
// we *do* want to request parents that are in m_lazy_recent_rejects_reconsiderable, since they can be CPFP'd.
180-
if (p2p_inv && AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true)) return true;
207+
if (AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true)) return true;
181208

182209
auto it = m_peer_info.find(peer);
183210
if (it == m_peer_info.end()) return false;
@@ -204,6 +231,36 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid,
204231
return false;
205232
}
206233

234+
std::optional<std::chrono::seconds> TxDownloadManagerImpl::OrphanResolutionCandidate(NodeId nodeid, const Wtxid& orphan_wtxid, size_t num_parents)
235+
{
236+
if (m_peer_info.count(nodeid) == 0) return std::nullopt;
237+
if (m_orphanage.HaveTxFromPeer(orphan_wtxid, nodeid)) return std::nullopt;
238+
239+
const auto& peer_entry = m_peer_info.at(nodeid);
240+
const auto& info = peer_entry.m_connection_info;
241+
// TODO: add delays and limits based on the amount of orphan resolution we are already doing
242+
// with this peer, how much they are using the orphanage, etc.
243+
if (!info.m_relay_permissions) {
244+
// This mirrors the delaying and dropping behavior in AddTxAnnouncement in order to preserve
245+
// existing behavior: drop if we are tracking too many invs for this peer already. Each
246+
// orphan resolution involves at least 1 transaction request which may or may not be
247+
// currently tracked in m_txrequest, so we include that in the count.
248+
if (m_txrequest.Count(nodeid) + num_parents > MAX_PEER_TX_ANNOUNCEMENTS) return std::nullopt;
249+
}
250+
251+
std::chrono::seconds delay{0s};
252+
if (!info.m_preferred) delay += NONPREF_PEER_TX_DELAY;
253+
// The orphan wtxid is used, but resolution entails requesting the parents by txid. Sometimes
254+
// parent and child are announced and thus requested around the same time, and we happen to
255+
// receive child sooner. Waiting a few seconds may allow us to cancel the orphan resolution
256+
// request if the parent arrives in that time.
257+
if (m_num_wtxid_peers > 0) delay += TXID_RELAY_DELAY;
258+
const bool overloaded = !info.m_relay_permissions && m_txrequest.CountInFlight(nodeid) >= MAX_PEER_TX_REQUEST_IN_FLIGHT;
259+
if (overloaded) delay += OVERLOADED_PEER_TX_DELAY;
260+
261+
return delay;
262+
}
263+
207264
std::vector<GenTxid> TxDownloadManagerImpl::GetRequestsToSend(NodeId nodeid, std::chrono::microseconds current_time)
208265
{
209266
std::vector<GenTxid> requests;
@@ -243,9 +300,11 @@ std::optional<PackageToValidate> TxDownloadManagerImpl::Find1P1CPackage(const CT
243300

244301
Assume(RecentRejectsReconsiderableFilter().contains(parent_wtxid.ToUint256()));
245302

246-
// Prefer children from this peer. This helps prevent censorship attempts in which an attacker
303+
// Only consider children from this peer. This helps prevent censorship attempts in which an attacker
247304
// sends lots of fake children for the parent, and we (unluckily) keep selecting the fake
248-
// children instead of the real one provided by the honest peer.
305+
// children instead of the real one provided by the honest peer. Since we track all announcers
306+
// of an orphan, this does not exclude parent + orphan pairs that we happened to request from
307+
// different peers.
249308
const auto cpfp_candidates_same_peer{m_orphanage.GetChildrenFromSamePeer(ptx, nodeid)};
250309

251310
// These children should be sorted from newest to oldest. In the (probably uncommon) case
@@ -258,34 +317,6 @@ std::optional<PackageToValidate> TxDownloadManagerImpl::Find1P1CPackage(const CT
258317
return PackageToValidate{ptx, child, nodeid, nodeid};
259318
}
260319
}
261-
262-
// If no suitable candidate from the same peer is found, also try children that were provided by
263-
// a different peer. This is useful because sometimes multiple peers announce both transactions
264-
// to us, and we happen to download them from different peers (we wouldn't have known that these
265-
// 2 transactions are related). We still want to find 1p1c packages then.
266-
//
267-
// If we start tracking all announcers of orphans, we can restrict this logic to parent + child
268-
// pairs in which both were provided by the same peer, i.e. delete this step.
269-
const auto cpfp_candidates_different_peer{m_orphanage.GetChildrenFromDifferentPeer(ptx, nodeid)};
270-
271-
// Find the first 1p1c that hasn't already been rejected. We randomize the order to not
272-
// create a bias that attackers can use to delay package acceptance.
273-
//
274-
// Create a random permutation of the indices.
275-
std::vector<size_t> tx_indices(cpfp_candidates_different_peer.size());
276-
std::iota(tx_indices.begin(), tx_indices.end(), 0);
277-
std::shuffle(tx_indices.begin(), tx_indices.end(), m_opts.m_rng);
278-
279-
for (const auto index : tx_indices) {
280-
// If we already tried a package and failed for any reason, the combined hash was
281-
// cached in m_lazy_recent_rejects_reconsiderable.
282-
const auto [child_tx, child_sender] = cpfp_candidates_different_peer.at(index);
283-
Package maybe_cpfp_package{ptx, child_tx};
284-
if (!RecentRejectsReconsiderableFilter().contains(GetPackageHash(maybe_cpfp_package)) &&
285-
!RecentRejectsFilter().contains(child_tx->GetHash().ToUint256())) {
286-
return PackageToValidate{ptx, child_tx, nodeid, child_sender};
287-
}
288-
}
289320
return std::nullopt;
290321
}
291322

@@ -301,14 +332,29 @@ void TxDownloadManagerImpl::MempoolAcceptedTx(const CTransactionRef& tx)
301332
m_orphanage.EraseTx(tx->GetWitnessHash());
302333
}
303334

335+
std::vector<Txid> TxDownloadManagerImpl::GetUniqueParents(const CTransaction& tx)
336+
{
337+
std::vector<Txid> unique_parents;
338+
unique_parents.reserve(tx.vin.size());
339+
for (const CTxIn& txin : tx.vin) {
340+
// We start with all parents, and then remove duplicates below.
341+
unique_parents.push_back(txin.prevout.hash);
342+
}
343+
344+
std::sort(unique_parents.begin(), unique_parents.end());
345+
unique_parents.erase(std::unique(unique_parents.begin(), unique_parents.end()), unique_parents.end());
346+
347+
return unique_parents;
348+
}
349+
304350
node::RejectedTxTodo TxDownloadManagerImpl::MempoolRejectedTx(const CTransactionRef& ptx, const TxValidationState& state, NodeId nodeid, bool first_time_failure)
305351
{
306352
const CTransaction& tx{*ptx};
307353
// Results returned to caller
308354
// Whether we should call AddToCompactExtraTransactions at the end
309355
bool add_extra_compact_tx{first_time_failure};
310356
// Hashes to pass to AddKnownTx later
311-
std::vector<uint256> unique_parents;
357+
std::vector<Txid> unique_parents;
312358
// Populated if failure is reconsiderable and eligible package is found.
313359
std::optional<node::PackageToValidate> package_to_validate;
314360

@@ -320,13 +366,7 @@ node::RejectedTxTodo TxDownloadManagerImpl::MempoolRejectedTx(const CTransaction
320366

321367
// Deduplicate parent txids, so that we don't have to loop over
322368
// the same parent txid more than once down below.
323-
unique_parents.reserve(tx.vin.size());
324-
for (const CTxIn& txin : tx.vin) {
325-
// We start with all parents, and then remove duplicates below.
326-
unique_parents.push_back(txin.prevout.hash);
327-
}
328-
std::sort(unique_parents.begin(), unique_parents.end());
329-
unique_parents.erase(std::unique(unique_parents.begin(), unique_parents.end()), unique_parents.end());
369+
unique_parents = GetUniqueParents(tx);
330370

331371
// Distinguish between parents in m_lazy_recent_rejects and m_lazy_recent_rejects_reconsiderable.
332372
// We can tolerate having up to 1 parent in m_lazy_recent_rejects_reconsiderable since we
@@ -348,30 +388,48 @@ node::RejectedTxTodo TxDownloadManagerImpl::MempoolRejectedTx(const CTransaction
348388
}
349389
}
350390
if (!fRejectedParents) {
351-
const auto current_time{GetTime<std::chrono::microseconds>()};
352-
353-
for (const uint256& parent_txid : unique_parents) {
354-
// Here, we only have the txid (and not wtxid) of the
355-
// inputs, so we only request in txid mode, even for
356-
// wtxidrelay peers.
357-
// Eventually we should replace this with an improved
358-
// protocol for getting all unconfirmed parents.
359-
const auto gtxid{GenTxid::Txid(parent_txid)};
360-
// Exclude m_lazy_recent_rejects_reconsiderable: the missing parent may have been
361-
// previously rejected for being too low feerate. This orphan might CPFP it.
362-
if (!AlreadyHaveTx(gtxid, /*include_reconsiderable=*/false)) {
363-
AddTxAnnouncement(nodeid, gtxid, current_time, /*p2p_inv=*/false);
391+
// Filter parents that we already have.
392+
// Exclude m_lazy_recent_rejects_reconsiderable: the missing parent may have been
393+
// previously rejected for being too low feerate. This orphan might CPFP it.
394+
std::erase_if(unique_parents, [&](const auto& txid){
395+
return AlreadyHaveTx(GenTxid::Txid(txid), /*include_reconsiderable=*/false);
396+
});
397+
const auto now{GetTime<std::chrono::microseconds>()};
398+
const auto& wtxid = ptx->GetWitnessHash();
399+
// Potentially flip add_extra_compact_tx to false if tx is already in orphanage, which
400+
// means it was already added to vExtraTxnForCompact.
401+
add_extra_compact_tx &= !m_orphanage.HaveTx(wtxid);
402+
403+
auto add_orphan_reso_candidate = [&](const CTransactionRef& orphan_tx, const std::vector<Txid>& unique_parents, NodeId nodeid, std::chrono::microseconds now) {
404+
const auto& wtxid = orphan_tx->GetWitnessHash();
405+
if (auto delay{OrphanResolutionCandidate(nodeid, wtxid, unique_parents.size())}) {
406+
const auto& info = m_peer_info.at(nodeid).m_connection_info;
407+
m_orphanage.AddTx(orphan_tx, nodeid);
408+
409+
// Treat finding orphan resolution candidate as equivalent to the peer announcing all missing parents
410+
// In the future, orphan resolution may include more explicit steps
411+
for (const auto& parent_txid : unique_parents) {
412+
m_txrequest.ReceivedInv(nodeid, GenTxid::Txid(parent_txid), info.m_preferred, now + *delay);
413+
}
414+
LogDebug(BCLog::TXPACKAGES, "added peer=%d as a candidate for resolving orphan %s\n", nodeid, wtxid.ToString());
364415
}
416+
};
417+
418+
// If there is no candidate for orphan resolution, AddTx will not be called. This means
419+
// that if a peer is overloading us with invs and orphans, they will eventually not be
420+
// able to add any more transactions to the orphanage.
421+
add_orphan_reso_candidate(ptx, unique_parents, nodeid, now);
422+
for (const auto& candidate : m_txrequest.GetCandidatePeers(ptx)) {
423+
add_orphan_reso_candidate(ptx, unique_parents, candidate, now);
365424
}
366425

367-
// Potentially flip add_extra_compact_tx to false if AddTx returns false because the tx was already there
368-
add_extra_compact_tx &= m_orphanage.AddTx(ptx, nodeid);
369-
370426
// Once added to the orphan pool, a tx is considered AlreadyHave, and we shouldn't request it anymore.
371427
m_txrequest.ForgetTxHash(tx.GetHash());
372428
m_txrequest.ForgetTxHash(tx.GetWitnessHash());
373429

374430
// DoS prevention: do not allow m_orphanage to grow unbounded (see CVE-2012-3789)
431+
// Note that, if the orphanage reaches capacity, it's possible that we immediately evict
432+
// the transaction we just added.
375433
m_orphanage.LimitOrphans(m_opts.m_max_orphan_txs, m_opts.m_rng);
376434
} else {
377435
unique_parents.clear();

src/node/txdownloadman_impl.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class TxDownloadManagerImpl {
163163
/** Consider adding this tx hash to txrequest. Should be called whenever a new inv has been received.
164164
* Also called internally when a transaction is missing parents so that we can request them.
165165
*/
166-
bool AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv);
166+
bool AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now);
167167

168168
/** Get getdata requests to send. */
169169
std::vector<GenTxid> GetRequestsToSend(NodeId nodeid, std::chrono::microseconds current_time);
@@ -189,6 +189,16 @@ class TxDownloadManagerImpl {
189189
void CheckIsEmpty(NodeId nodeid);
190190

191191
std::vector<TxOrphanage::OrphanTxBase> GetOrphanTransactions() const;
192+
193+
protected:
194+
/** Helper for getting deduplicated vector of Txids in vin. */
195+
std::vector<Txid> GetUniqueParents(const CTransaction& tx);
196+
197+
/** Determine candidacy (and delay) for potential orphan resolution candidate.
198+
* @returns delay for orphan resolution if this peer is a good candidate for orphan resolution,
199+
* std::nullopt if this peer cannot be added because it has reached download/orphanage limits.
200+
* */
201+
std::optional<std::chrono::seconds> OrphanResolutionCandidate(NodeId nodeid, const Wtxid& orphan_wtxid, size_t num_parents);
192202
};
193203
} // namespace node
194204
#endif // BITCOIN_NODE_TXDOWNLOADMAN_IMPL_H

src/rpc/mempool.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,9 @@ static UniValue OrphanToJSON(const TxOrphanage::OrphanTxBase& orphan)
845845
o.pushKV("entry", int64_t{TicksSinceEpoch<std::chrono::seconds>(orphan.nTimeExpire - ORPHAN_TX_EXPIRE_TIME)});
846846
o.pushKV("expiration", int64_t{TicksSinceEpoch<std::chrono::seconds>(orphan.nTimeExpire)});
847847
UniValue from(UniValue::VARR);
848-
from.push_back(orphan.fromPeer); // only one fromPeer for now
848+
for (const auto fromPeer: orphan.announcers) {
849+
from.push_back(fromPeer);
850+
}
849851
o.pushKV("from", from);
850852
return o;
851853
}

src/test/fuzz/txdownloadman.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ FUZZ_TARGET(txdownloadman, .init = initialize)
230230
GenTxid gtxid = fuzzed_data_provider.ConsumeBool() ?
231231
GenTxid::Txid(rand_tx->GetHash()) :
232232
GenTxid::Wtxid(rand_tx->GetWitnessHash());
233-
txdownloadman.AddTxAnnouncement(rand_peer, gtxid, time, /*p2p_inv=*/fuzzed_data_provider.ConsumeBool());
233+
txdownloadman.AddTxAnnouncement(rand_peer, gtxid, time);
234234
},
235235
[&] {
236236
txdownloadman.GetRequestsToSend(rand_peer, time);
@@ -375,7 +375,7 @@ FUZZ_TARGET(txdownloadman_impl, .init = initialize)
375375
GenTxid gtxid = fuzzed_data_provider.ConsumeBool() ?
376376
GenTxid::Txid(rand_tx->GetHash()) :
377377
GenTxid::Wtxid(rand_tx->GetWitnessHash());
378-
txdownload_impl.AddTxAnnouncement(rand_peer, gtxid, time, /*p2p_inv=*/fuzzed_data_provider.ConsumeBool());
378+
txdownload_impl.AddTxAnnouncement(rand_peer, gtxid, time);
379379
},
380380
[&] {
381381
const auto getdata_requests = txdownload_impl.GetRequestsToSend(rand_peer, time);

0 commit comments

Comments
 (0)