Data: Don't corrupt hidden RI with addresses

This commit is contained in:
zzz
2018-09-27 14:38:18 +00:00
parent a69aa15acd
commit d67d501b28
2 changed files with 5 additions and 8 deletions

View File

@@ -336,15 +336,12 @@ public class RouterInfo extends DatabaseEntry {
if (_published < 0) throw new DataFormatException("Invalid published date: " + _published);
_identity.writeBytes(out);
// avoid thrashing objects
//DataHelper.writeDate(out, new Date(_published));
DataHelper.writeLong(out, 8, _published);
// There shouldn't be any addresses when hidden, but if there are,
// write them out, so as not to invalidate the signature
int sz = _addresses.size();
if (sz <= 0 || isHidden()) {
// Do not send IP address to peers in hidden mode
out.write((byte) 0);
} else {
out.write((byte) sz);
out.write((byte) sz);
if (sz > 0) {
for (RouterAddress addr : _addresses) {
addr.writeBytes(out);
}

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 9;
public final static long BUILD = 10;
/** for example "-test" */
public final static String EXTRA = "-rc";