From e6e95829bcc4446b882c3263d5769d39467721df Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Sep 2016 13:44:53 +0200 Subject: [PATCH] fixed bug in estimation of next FT rate that caused downloads to stuck for a while --- libretroshare/src/ft/fttransfermodule.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/ft/fttransfermodule.cc b/libretroshare/src/ft/fttransfermodule.cc index f5d5dfe84..7943a394b 100644 --- a/libretroshare/src/ft/fttransfermodule.cc +++ b/libretroshare/src/ft/fttransfermodule.cc @@ -739,7 +739,7 @@ bool ftTransferModule::locked_tickPeerTransfer(peerInfo &info) #endif /* update rate */ - if(info.lastTransfers > 0 || ageReq > 2) + if( (info.lastTransfers > 0 && ageReq > 0) || ageReq > 2) { info.actualRate = info.actualRate * 0.75 + 0.25 * info.lastTransfers / (float)ageReq; info.lastTransfers = 0;