Change the amount of transactions sent per transaction INV trickle to:
INVENTORY_BROADCAST_TARGET + queue.size() * (1 - exp(-time_in_queue / INVENTORY_AVG_TIME_IN_QUEUE))
where:
INVENTORY_BROADCAST_TARGET
is the currentINVENTORY_BROADCAST_PER_SECOND
-derived constant 70.INVENTORY_AVG_TIME_IN_QUEUE
is a new constant (60s).time_in_queue
is the time since the last INV trickle.
The second term here implements an exponentially-decaying queue size with time constant INVENTORY_AVG_TIME_IN_QUEUE
, so under high constant load, the queue size will converge to however many transactions arrived within that time (60s).
To account for the fact that only integral numbers of inventories can be sent, time_in_queue
is adjusted so it corresponds to the since the time at which the previous actual number of transactions would have corresponding to the formula.