This is a simpler alternative to #5463, in order to solve #5588.
Disconnect peers which take longer than block interval time to download a block from, with extra time given in case the block was requested with existing parallel downloads queued.
This will disconnect peers that do not transfer a block in 10 minutes, plus
5 minutes for every previously queued block with validated headers
(accomodating downstream bandwidth down to a few kilobytes per second - below
that the node would have trouble staying synchronized anyway).
4528@@ -4522,6 +4529,10 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
4529 LogPrintf("Peer=%d is stalling block download, disconnecting\n", pto->id);
4530 pto->fDisconnect = true;
4531 }
4532+ if (!pto->fDisconnect && state.vBlocksInFlight.size() > 0 && state.vBlocksInFlight.front().nTime < nNow - 500000 * Params().TargetSpacing() * (2 + state.vBlocksInFlight.front().nValidatedQueuedBefore)) {
4533@@ -4527,6 +4534,15 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
4534 LogPrintf("Peer=%d is stalling block download, disconnecting\n", pto->id);
4535 pto->fDisconnect = true;
4536 }
4537+ // In case there is a block that has been in flight from this peer for (1 + 0.5 * N) times the block interval