Skip to content

Commit b81f370

Browse files
ajtownssdaftuar
andcommitted
p2p: Increase tx relay rate
In the presence of smaller transactions on the network, blocks can sustain a higher relay rate than 7tx/second. In this event, the per-peer inventory queues can grow too large. This commit bumps the rate up to 14 tx/s (for inbound peers), increasing the safety margin by a factor of 2. Outbound peers continue to receive relayed transactions at 2.5x the rate of inbound peers, for a rate of 35tx/second. Co-Authored-By: Suhas Daftuar <sdaftuar@gmail.com>
1 parent ebe4cac commit b81f370

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static constexpr auto INBOUND_INVENTORY_BROADCAST_INTERVAL{5s};
136136
static constexpr auto OUTBOUND_INVENTORY_BROADCAST_INTERVAL{2s};
137137
/** Maximum rate of inventory items to send per second.
138138
* Limits the impact of low-fee transaction floods. */
139-
static constexpr unsigned int INVENTORY_BROADCAST_PER_SECOND = 7;
139+
static constexpr unsigned int INVENTORY_BROADCAST_PER_SECOND{14};
140140
/** Target number of tx inventory items to send per transmission. */
141141
static constexpr unsigned int INVENTORY_BROADCAST_TARGET = INVENTORY_BROADCAST_PER_SECOND * count_seconds(INBOUND_INVENTORY_BROADCAST_INTERVAL);
142142
/** Maximum number of inventory items to send per transmission. */

0 commit comments

Comments
 (0)