private broadcast: wait synchronously for mempool acceptance #36566

pull andrewtoth wants to merge 4 commits into bitcoin:master from andrewtoth:private-broadcast-wait changing 17 files +259 −42
  1. andrewtoth commented at 5:57 PM on October 18, 2026: contributor

    Calling BroadcastTransaction with the NO_MEMPOOL_PRIVATE_BROADCAST method skips inserting the transaction into the mempool and returns immediately. This causes problems with software that expects the transaction to be in the mempool after the function returns. For example many third-party wallets or services call sendrawtransaction and expect the transaction to be in the mempool after it returns a successful response.

    This PR adds a new TransactionAddedToMempoolSync method to CValidationInterface. This is then used in BroadcastTransaction when the method is NO_MEMPOOL_PRIVATE_BROADCAST to wait for the transaction to have been accepted back into the mempool before returning. It also adds a timeout (default 10 minutes) to BroadcastTransaction and exposes it as an option for sendrawtransaction. Setting the timeout to 0 disables the wait and returns immediately, preserving the current behavior.

    Synchronously waiting for mempool acceptance is also a prerequisite for adding private broadcast support to the wallet. The TransactionAddedToMempoolSync method is added specifically for future wallet broadcasting, so a broadcast caller holding cs_wallet will not timeout waiting on another background event that is also trying to acquire cs_wallet.

  2. validation: add synchronous mempool acceptance notification
    Notify validation subscribers synchronously after queuing the existing mempool acceptance event. This allows acceptance waiters to wake independently of the background notification queue.
    9e7e5dcf78
  3. node: support waiting for private broadcast mempool acceptance
    Subscribe before private broadcast submission and wait for local mempool acceptance, timeout, or shutdown. Synchronous acceptance notifications allow callers holding the wallet lock to wait without draining its notification queue.
    8f89a7a95a
  4. rpc: wait for private broadcast acceptance in sendrawtransaction
    Expose the private broadcast timeout in sendrawtransaction and default private broadcasts to a ten-minute wait.
    9f3c95e8c4
  5. doc: add release notes for private broadcast wait bccae01515
  6. andrewtoth force-pushed on Oct 18, 2026
  7. fanquake added the label Private Broadcast on Oct 19, 2026
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-19 04:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me