[#TxRequestTracker-ReceivedInv]
= xref:TxRequestTracker.adoc[TxRequestTracker]::ReceivedInv
:relfileprefix: ../
:mrdocs:

Adds a new CANDIDATE announcement&period;

== Synopsis

Declared in `&lt;txrequest&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
ReceivedInv(
    xref:NodeId-08.adoc[NodeId] peer,
    xref:GenTxid.adoc[GenTxid] const& gtxid,
    bool preferred,
    std::chrono::microseconds reqtime);
----

== Description

Does nothing if one already exists for that (txhash, peer) combination (whether it&apos;s CANDIDATE, REQUESTED, or COMPLETED)&period; Note that the txid&sol;wtxid property is ignored for determining uniqueness, so if an announcement is added for a wtxid H, while one for txid H from the same peer already exists, it will be ignored&period; This is harmless as the txhashes being equal implies it is a non&hyphen;segwit transaction, so it doesn&apos;t matter how it is fetched&period; The new announcement is given the specified preferred and reqtime values, and takes its is&lowbar;wtxid from the specified gtxid&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *peer*
| Peer that announced the transaction&period;
| *gtxid*
| Announced txid or wtxid, which also carries the is&lowbar;wtxid flag&period;
| *preferred*
| Whether the announcement comes from a preferred peer&period;
| *reqtime*
| Earliest time the transaction may be requested from this peer&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
