[#PrivateBroadcast]
= PrivateBroadcast
:mrdocs:

Store a list of transactions to be broadcast privately&period; Supports the following operations&colon; &hyphen; Add a new transaction &hyphen; Remove a transaction &hyphen; Pick a transaction for sending to one recipient &hyphen; Query which transaction has been picked for sending to a given recipient node &hyphen; Mark that a given recipient node has confirmed receipt of a transaction &hyphen; Query whether a given recipient node has confirmed reception &hyphen; Query whether any transactions that need sending are currently on the list

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class PrivateBroadcast;
----

== Types

[cols="1,4"]
|===
| Name| Description
| xref:PrivateBroadcast/PeerSendInfo.adoc[`PeerSendInfo`] 
| Per&hyphen;recipient record of when a transaction was sent and (optionally) received back&period;
| xref:PrivateBroadcast/TxBroadcastInfo.adoc[`TxBroadcastInfo`] 
| Public snapshot of a tracked transaction and its per&hyphen;peer broadcast history&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:PrivateBroadcast/AddResult.adoc[`AddResult`] 
| Outcome of Add()&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:PrivateBroadcast/2constructor.adoc[`PrivateBroadcast`]         [.small]#[constructor]#
| Construct a private broadcast store with optional capacity limits&period;
| xref:PrivateBroadcast/Add.adoc[`Add`] 
| Add a transaction to the storage, or reset an exhausted transaction so it can be broadcast again&period;
| xref:PrivateBroadcast/DidNodeConfirmReception.adoc[`DidNodeConfirmReception`] 
| Check if the node has confirmed reception of the transaction&period;
| xref:PrivateBroadcast/GetBroadcastInfo.adoc[`GetBroadcastInfo`] 
| Get stats about all transactions currently being privately broadcast&period;
| xref:PrivateBroadcast/GetStale.adoc[`GetStale`] 
| Get the transactions that have not been broadcast recently and have send attempts remaining&period;
| xref:PrivateBroadcast/GetTxForNode.adoc[`GetTxForNode`] 
| Get the transaction that was picked for sending to a given node by PickTxForSend()&period;
| xref:PrivateBroadcast/HavePendingTransactions.adoc[`HavePendingTransactions`] 
| Check if there are transactions with send attempts remaining&period;
| xref:PrivateBroadcast/NodeConfirmedReception.adoc[`NodeConfirmedReception`] 
| Mark that the node has confirmed reception of the transaction we sent it by responding with `PONG` to our `PING` message&period;
| xref:PrivateBroadcast/PickTxForSend.adoc[`PickTxForSend`] 
| Pick the transaction with the fewest send attempts, and confirmations, and oldest send&sol;confirm times&period;
| xref:PrivateBroadcast/Remove.adoc[`Remove`] 
| Forget a transaction&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:PrivateBroadcast/INITIAL_STALE_DURATION.adoc[`INITIAL&lowbar;STALE&lowbar;DURATION`] 
| If a transaction is not sent to any peer for this duration, then we consider it stale &sol; for rebroadcasting&period;
| xref:PrivateBroadcast/MAX_SEND_ATTEMPTS.adoc[`MAX&lowbar;SEND&lowbar;ATTEMPTS`] 
| Maximum number of send attempts for a transaction&period; Once this limit is reached, the transaction remains tracked but is not sent again unless explicitly re&hyphen;added&period;
| xref:PrivateBroadcast/MAX_TRANSACTIONS.adoc[`MAX&lowbar;TRANSACTIONS`] 
| Maximum number of transactions tracked simultaneously&period; Additions that would exceed this are rejected (see Add())&period;
| xref:PrivateBroadcast/STALE_DURATION.adoc[`STALE&lowbar;DURATION`] 
| If a transaction is not received back from the network for this duration after it is broadcast, then we consider it stale &sol; for rebroadcasting&period;
|===



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