mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
init: add -txsendrate configuration parameter
Adds a debug-only configuration option to set the target transaction/second rate for relay to inbound connections. This is mostly intended to be set to artificially low values to aid in testing behaviour when a backlog occurs, but is also available in case the default 14tx/s target is somehow too low in practice.
This commit is contained in:
@@ -24,6 +24,10 @@ void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& optio
|
||||
|
||||
if (auto value{argsman.GetBoolArg("-blocksonly")}) options.ignore_incoming_txs = *value;
|
||||
|
||||
if (auto value{argsman.GetIntArg("-txsendrate")}) {
|
||||
options.tx_send_rate = uint32_t(std::clamp<int64_t>(*value, 1, 1000));
|
||||
}
|
||||
|
||||
if (auto value{argsman.GetBoolArg("-privatebroadcast")}) options.private_broadcast = *value;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class TxDownloadManagerImpl;
|
||||
static constexpr int32_t MAX_PEER_TX_REQUEST_IN_FLIGHT = 100;
|
||||
/** Maximum number of transactions to consider for requesting, per peer. It provides a reasonable DoS limit to
|
||||
* per-peer memory usage spent on announcements, while covering peers continuously sending INVs at the maximum
|
||||
* rate (by our own policy, see INVENTORY_BROADCAST_PER_SECOND) for several minutes, while not receiving
|
||||
* rate (by our own policy, see DEFAULT_TX_SEND_RATE) for several minutes, while not receiving
|
||||
* the actual transaction (from any peer) in response to requests for them. */
|
||||
static constexpr int32_t MAX_PEER_TX_ANNOUNCEMENTS = 5000;
|
||||
/** How long to delay requesting transactions via txids, if we have wtxid-relaying peers */
|
||||
|
||||
Reference in New Issue
Block a user