combinatorrent
combinatorrent copied to clipboard
Use a rate estimate to decide how many blocks to request from the piece manager.
We currently always request 25 blocks and then do a rerequest when it hits 5 blocks left. In practice, a better solution is to take the upload rate, multiply it by a number of seconds (3-5) and then divide by the typical block size, e.g., around 17 kilobytes. This number is the number of pieces to request. We should also use this value to update the bound where we should fill up more blocks. In practice you need a bandwidth*delay product if this is to be done right.
if we can't get enough blocks, we can stop asking until something changes the game or a timer of 10 seconds or so expire.