[#PrivateBroadcast] = PrivateBroadcast :mrdocs: Store a list of transactions to be broadcast privately. Supports the following operations: ‐ Add a new transaction ‐ Remove a transaction ‐ Pick a transaction for sending to one recipient ‐ Query which transaction has been picked for sending to a given recipient node ‐ Mark that a given recipient node has confirmed receipt of a transaction ‐ Query whether a given recipient node has confirmed reception ‐ Query whether any transactions that need sending are currently on the list == Synopsis Declared in `<private_broadcast.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class PrivateBroadcast; ---- == Types [cols="1,4"] |=== | Name| Description | xref:PrivateBroadcast/PeerSendInfo.adoc[`PeerSendInfo`] | Per‐recipient record of when a transaction was sent and (optionally) received back. | xref:PrivateBroadcast/TxBroadcastInfo.adoc[`TxBroadcastInfo`] | Public snapshot of a tracked transaction and its per‐peer broadcast history. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:PrivateBroadcast/AddResult.adoc[`AddResult`] | Outcome of Add(). |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:PrivateBroadcast/2constructor.adoc[`PrivateBroadcast`] [.small]#[constructor]# | Construct a private broadcast store with optional capacity limits. | xref:PrivateBroadcast/Add.adoc[`Add`] | Add a transaction to the storage, or reset an exhausted transaction so it can be broadcast again. | xref:PrivateBroadcast/DidNodeConfirmReception.adoc[`DidNodeConfirmReception`] | Check if the node has confirmed reception of the transaction. | xref:PrivateBroadcast/GetBroadcastInfo.adoc[`GetBroadcastInfo`] | Get stats about all transactions currently being privately broadcast. | xref:PrivateBroadcast/GetStale.adoc[`GetStale`] | Get the transactions that have not been broadcast recently and have send attempts remaining. | xref:PrivateBroadcast/GetTxForNode.adoc[`GetTxForNode`] | Get the transaction that was picked for sending to a given node by PickTxForSend(). | xref:PrivateBroadcast/HavePendingTransactions.adoc[`HavePendingTransactions`] | Check if there are transactions with send attempts remaining. | 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. | xref:PrivateBroadcast/PickTxForSend.adoc[`PickTxForSend`] | Pick the transaction with the fewest send attempts, and confirmations, and oldest send/confirm times. | xref:PrivateBroadcast/Remove.adoc[`Remove`] | Forget a transaction. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:PrivateBroadcast/INITIAL_STALE_DURATION.adoc[`INITIAL_STALE_DURATION`] | If a transaction is not sent to any peer for this duration, then we consider it stale / for rebroadcasting. | xref:PrivateBroadcast/MAX_SEND_ATTEMPTS.adoc[`MAX_SEND_ATTEMPTS`] | Maximum number of send attempts for a transaction. Once this limit is reached, the transaction remains tracked but is not sent again unless explicitly re‐added. | xref:PrivateBroadcast/MAX_TRANSACTIONS.adoc[`MAX_TRANSACTIONS`] | Maximum number of transactions tracked simultaneously. Additions that would exceed this are rejected (see Add()). | xref:PrivateBroadcast/STALE_DURATION.adoc[`STALE_DURATION`] | If a transaction is not received back from the network for this duration after it is broadcast, then we consider it stale / for rebroadcasting. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#