* I2PTunnel: Save keys to privkey file when enabling

persistent key after tunnel creation (ticket #480)
This commit is contained in:
zzz
2011-09-06 13:23:09 +00:00
parent fdc3af97aa
commit d9b37ac6f0

View File

@@ -156,6 +156,15 @@ public class TunnelController implements Logging {
_log.warn("Cannot start the tunnel - no type specified");
return;
}
// Config options may have changed since instantiation, so do this again.
// Or should we take it out of the constructor completely?
if (type.endsWith("server") || getPersistentClientKey()) {
boolean ok = createPrivateKey();
if (!ok) {
log("Failed to start tunnel " + getName() + " as the private key file could not be created");
return;
}
}
setI2CPOptions();
setSessionOptions();
if ("httpclient".equals(type)) {