- fix requesting the same object over and over again, now it continues to
iterate through the other objects and only resets the queue after a timeout
after the last received object
- a bug in RandomTrackingDict caused requesting to download the same objects
over and over
- the bug is that the lastObject wasn't properly initalised, this caused the
write buffer to fill with "getdata" requests until the first object was
received
- this PR should address both the excessive bandwidth as well as excessive CPU
usage during downloading
- in corner cases, download request could have contained an incorrect
request length. I haven't actually checked if this can be triggered
though
- wait for downloading until anti intersection delay expires. Doesn't
necessarily mean that it will always avoid peer's anti intersection
delay, but it's close enough
- tracks last time an object was received. If it was too long time ago,
reset the download request queue. This avoid situations like when a
request gets ignored during the anti intersection delay, but it will
keep thinking there are still pending requests as long as not all
missing objects have been requested. This caused staggered download
(request 1000 items, wait 1 minute, request 1000 more, wait another
minute, ...)
- with these fixes, you should end up downloading as fast as your
network and CPU allow
- best tested with trustedpeer