Skip to content

Commit

Permalink
Fix netdb.knownLeaseSets count reported by floodfill routers
Browse files Browse the repository at this point in the history
  • Loading branch information
zzz committed Mar 1, 2008
1 parent a739787 commit c46b06f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2008-03-01 zzz
* Fix netdb.knownLeaseSets count reported by floodfill routers
(was broken by -3)

2008-02-27 zzz
* i2ptunnel: Add 3-hop option to edit.jsp to match configtunnels.jsp
* i2psnark: Remove orion and gaytorrents from default tracker list
Expand Down
2 changes: 1 addition & 1 deletion router/java/src/net/i2p/router/RouterVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class RouterVersion {
public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $";
public final static String VERSION = "0.6.1.31";
public final static long BUILD = 8;
public final static long BUILD = 9;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public void put(Hash key, DataStructure data) {
_writer.queue(key, data);
}

/*
* We don't store leasesets here anymore, use the TransientDataStore count
*
public int countLeaseSets() {
File dbDir = null;
try {
Expand All @@ -86,6 +89,7 @@ public int countLeaseSets() {
else
return leaseSetFiles.length;
}
*/

private void accept(LeaseSet ls) {
super.put(ls.getDestination().calculateHash(), ls);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ public boolean isKnown(Hash key) {
}
}

public int countLeaseSets() { return 0; }

public int countLeaseSets() {
int count = 0;
synchronized (_data) {
for (Iterator iter = _data.values().iterator(); iter.hasNext();) {
DataStructure data = (DataStructure)iter.next();
if (data instanceof LeaseSet)
count++;
}
}
return count;
}

/** nothing published more than 5 minutes in the future */
private final static long MAX_FUTURE_PUBLISH_DATE = 5*60*1000;
Expand Down

0 comments on commit c46b06f

Please sign in to comment.