Author: toad
Date: 2008-04-10 18:27:11 +0000 (Thu, 10 Apr 2008)
New Revision: 19150

Modified:
   trunk/freenet/src/freenet/node/NodeStats.java
Log:
Revert 18846. Doing it by the fraction causes nasty problems - the node won't 
recover.
Will fix the problems leading up to 18846 a different way...

Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java       2008-04-10 17:36:13 UTC 
(rev 19149)
+++ trunk/freenet/src/freenet/node/NodeStats.java       2008-04-10 18:27:11 UTC 
(rev 19150)
@@ -488,10 +488,7 @@
                        successfulChkOfferReplyBytesSentAverage.currentValue() 
* numCHKOfferReplies +
                        successfulSskOfferReplyBytesSentAverage.currentValue() 
* numSSKOfferReplies;
                double bandwidthAvailableOutput =
-                       // It's safer to use the fraction. If for some reason 
our output has been over the limit
-                       // for a while, (which we cannot entirely eliminate 
with the current code), doing it the
-                       // other way could produce a very low or even negative 
number.
-                       (node.getOutputBandwidthLimit() * overheadFraction) * 
90; // 90 seconds at full power; we have to leave some time for the search as 
well
+                       (node.getOutputBandwidthLimit() - 
sentOverheadPerSecond) * 90; // 90 seconds at full power; we have to leave some 
time for the search as well
                if(bandwidthLiabilityOutput > bandwidthAvailableOutput) {
                        pInstantRejectIncoming.report(1.0);
                        rejected("Output bandwidth liability", isLocal);


Reply via email to