[#PrivateBroadcast-PickTxForSend]
= xref:PrivateBroadcast.adoc[PrivateBroadcast]::PickTxForSend
:relfileprefix: ../
:mrdocs:

Pick the transaction with the fewest send attempts, and confirmations, and oldest send&sol;confirm times&period;

== Synopsis

Declared in `&lt;private&lowbar;broadcast&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f950ef0cbe8), requires&lowbar;capability(0x7f950e3e7b08), requires&lowbar;capability(0x7f9502a9e4f8)&rsqb;&rsqb;
std::optional&lt;CTransactionRef&gt;
PickTxForSend(
    xref:NodeId-08.adoc[NodeId] const& will&lowbar;send&lowbar;to&lowbar;nodeid,
    xref:CService.adoc[CService] const& will&lowbar;send&lowbar;to&lowbar;address);
----

== Return Value

Most urgent transaction or nullopt if there are no transactions with send attempts remaining&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *will&lowbar;send&lowbar;to&lowbar;nodeid* [in]
| Will remember that the returned transaction was picked for sending to this node&period; Calling this method more than once with the same `will&lowbar;send&lowbar;to&lowbar;nodeid` is not allowed because sending more than one transaction to one node would be a privacy leak&period;
| *will&lowbar;send&lowbar;to&lowbar;address* [in]
| Address of the peer to which this transaction will be sent&period;
|===


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