forked from I2P_Developers/i2p.i2p
i2ptunnel: Prevent changing sigtype after dest creation (ticket #2128)
Fix HTML error in editClient
This commit is contained in:
@ -504,6 +504,8 @@ public class GeneralHelper {
|
||||
|
||||
/**
|
||||
* @param newTunnelType used if tunnel < 0
|
||||
* @return the current type if we have a destination already,
|
||||
* else the default for that type of tunnel
|
||||
*/
|
||||
public int getSigType(int tunnel, String newTunnelType) {
|
||||
SigType type;
|
||||
|
@ -23,6 +23,7 @@ import net.i2p.data.Signature;
|
||||
import net.i2p.data.SigningPrivateKey;
|
||||
import net.i2p.i2ptunnel.TunnelController;
|
||||
import net.i2p.i2ptunnel.TunnelControllerGroup;
|
||||
import net.i2p.i2ptunnel.ui.GeneralHelper;
|
||||
import net.i2p.util.Addresses;
|
||||
|
||||
/**
|
||||
@ -222,7 +223,16 @@ public class EditBean extends IndexBean {
|
||||
public boolean isSigTypeAvailable(int code) {
|
||||
return SigType.isAvailable(code);
|
||||
}
|
||||
|
||||
|
||||
/** @since 0.9.33 */
|
||||
public boolean canChangeSigType(int tunnel) {
|
||||
if (tunnel < 0)
|
||||
return true;
|
||||
if (getDestination(tunnel) != null)
|
||||
return false;
|
||||
return getTunnelStatus(tunnel) == GeneralHelper.NOT_RUNNING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Random keys, hidden in forms
|
||||
* @since 0.9.18
|
||||
|
Reference in New Issue
Block a user