updateQuotas

fun updateQuotas(dtMilliseconds: Long)

Runs one scheduling round over an elapsed dtMilliseconds. Faithful to bandwidth_manager::update_quotas (which first converts its time_duration via total_milliseconds):

  1. nothing to do while aborted or with an empty queue; the elapsed time is clamped to 3000 ms so a long stall cannot dump a huge burst;

  2. disconnecting peers are pulled out, their assigned quota refunded to their channels, and they are dispatched with 0;

  3. each live channel's BandwidthChannel.tmp accumulates the summed priority of the requests competing for it, then its token bucket is refilled once;

  4. each request takes its proportional share; requests that are now full, or that have run out of BwRequest.ttl with something assigned, are dispatched and removed;

  5. queuedBytes is decremented by everything handed out or dropped.