Author: toad
Date: 2007-11-27 17:18:09 +0000 (Tue, 27 Nov 2007)
New Revision: 15972
Modified:
trunk/freenet/src/freenet/node/Node.java
Log:
Fix bootID creation
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2007-11-27 17:15:15 UTC (rev
15971)
+++ trunk/freenet/src/freenet/node/Node.java 2007-11-27 17:18:09 UTC (rev
15972)
@@ -617,17 +617,16 @@
String s = new String(buf, "ISO-8859-1");
try {
oldBootID = Fields.hexToLong(s);
- raf.seek(0);
- s =
HexUtil.bytesToHex(Fields.longToBytes(bootID));
- buf = s.getBytes("ISO-8859-1");
- if(buf.length != BOOT_FILE_LENGTH)
- System.err.println("Not 16
bytes for boot ID "+bootID+" - WTF??");
- raf.write(buf);
} catch (NumberFormatException e) {
oldBootID = -1;
}
-
+ raf.seek(0);
}
+ String s =
HexUtil.bytesToHex(Fields.longToBytes(bootID));
+ byte[] buf = s.getBytes("ISO-8859-1");
+ if(buf.length != BOOT_FILE_LENGTH)
+ System.err.println("Not 16 bytes for boot ID
"+bootID+" - WTF??");
+ raf.write(buf);
} catch (IOException e) {
oldBootID = -1;
// If we have an error in reading, *or in writing*, we
don't reliably know the last boot ID.