rpc: Add abortprivatebroadcast

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
Andrew Toth
2026-01-17 18:33:28 -05:00
parent 15dff452eb
commit 557260ca14
4 changed files with 91 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
#include <private_broadcast.h>
#include <protocol.h>
#include <threadsafety.h>
#include <uint256.h>
#include <util/expected.h>
#include <validationinterface.h>
@@ -122,6 +123,18 @@ public:
/** Get info about transactions currently being privately broadcast. */
virtual std::vector<PrivateBroadcast::TxBroadcastInfo> GetPrivateBroadcastInfo() const = 0;
/**
* Abort private broadcast attempts for transactions currently being privately broadcast.
*
* @param[in] id A transaction identifier. It will be matched against both txid and wtxid for
* all transactions in the private broadcast queue.
*
* @return Transactions removed from the private broadcast queue. If the provided id matches a
* txid that corresponds to multiple transactions with different wtxids, multiple
* transactions may be returned.
*/
virtual std::vector<CTransactionRef> AbortPrivateBroadcast(const uint256& id) = 0;
/**
* Initiate a transaction broadcast to eligible peers.
* Queue the witness transaction id to `Peer::TxRelay::m_tx_inventory_to_send`