Skip to content

Commit

Permalink
fix: check correct variable, avoid unnecessary checks.
Browse files Browse the repository at this point in the history
Thanks to Bombe!
  • Loading branch information
ArneBab committed Jan 27, 2025
1 parent 3d41b7d commit 84bb9c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/freenet/node/FailureTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ public void start() {
*/
public void onFailed(Key key, PeerNode routedTo, short htl, long rfTimeout, long ftTimeout) {
if(ftTimeout < 0 || ftTimeout > REJECT_TIME) {
if (ftTimeout > 0 && rfTimeout > REJECT_TIME_BEFORE_BUILD_1498) { // only log an error if the time is invalid for 1497, too
if (ftTimeout > REJECT_TIME_BEFORE_BUILD_1498) { // only log an error if the time is invalid for 1497, too
Logger.error(this, "Bogus timeout "+ftTimeout, new Exception("error"));
}
ftTimeout = Math.max(Math.min(REJECT_TIME, ftTimeout), 0);
}
if(rfTimeout < 0 || rfTimeout > RECENTLY_FAILED_TIME) {
if(rfTimeout > 0 && rfTimeout > RECENTLY_FAILED_TIME_BEFORE_BUILD_1498) { // only log an error if the time is invalid for 1497, too
if(rfTimeout > RECENTLY_FAILED_TIME_BEFORE_BUILD_1498) { // only log an error if the time is invalid for 1497, too
Logger.error(this, "Bogus timeout "+rfTimeout, new Exception("error"));
}
rfTimeout = Math.max(Math.min(RECENTLY_FAILED_TIME, rfTimeout), 0);
Expand Down

0 comments on commit 84bb9c2

Please sign in to comment.