Review report

core: PR #34271

2 suggestions

Optional improvements

Link

[suggestion] · Missing private-broadcast storage can make a failed submission look successful

If RPC arguments and PeerManager options disagree, sendrawtransaction can return a txid without inserting or queuing a new transaction.

Location: src/net_processing.cpp:2313 (head).

Details and suggested fix

sendrawtransaction selects private broadcast from gArgs, while storage engagement depends on PeerManager::Options::private_broadcast. If the argument is true but the construction option is false, an otherwise acceptable transaction absent from the mempool is only test-accepted. The new guard then logs and returns without queuing it, and BroadcastTransaction returns OK because the initiation API returns void. The base implementation attempted to queue the transaction regardless of that option. Normal startup and TestingSetup derive the options from their ArgsManager; no current caller producing this mismatch was found, so production occurrence is unconfirmed. As an API-hardening improvement, return an explicit failure from InitiateTxBroadcastPrivate and propagate it through BroadcastTransaction to the RPC, while preserving success for an already-queued transaction. Do not silently fall back to public broadcast when the user requested private broadcast.


Link

[suggestion] · P2P fuzz targets skip private-broadcast storage

The process_message, process_messages and p2p_handshake fuzzers can create PRIVATE_BROADCAST peers with storage disabled, so completed handshakes now exercise the warning branch instead of PickTxForSend.

Location: src/net_processing.cpp:3608 (head).

Details and suggested fix

These three harnesses construct PeerManager with private_broadcast left at its false default, but ConsumeNode can select ConnectionType::PRIVATE_BROADCAST. Unlike the production configuration, that pairing leaves the new optional disengaged. A completed private-peer handshake now takes the warning-and-disconnect branch before PickTxForSend, and finalization also skips DidNodeConfirmReception and HavePendingTransactions. Set .private_broadcast = true in these harnesses to restore those storage calls and keep private peers paired with enabled storage. This restores only shallow coverage: the queue remains empty, and successful private GETDATA and PONG handling was not covered before this change either.


Coverage details