forked from I2P_Developers/i2p.i2p
Console: Support deleting blinded entries on /configkeyring
This commit is contained in:
@ -187,4 +187,13 @@ public abstract class NetworkDatabaseFacade implements Service {
|
||||
public List<BlindData> getBlindData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* For console ConfigKeyringHelper
|
||||
* @return true if removed
|
||||
* @since 0.9.41
|
||||
*/
|
||||
public boolean removeBlindData(SigningPublicKey spk) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -249,6 +249,28 @@ class BlindCache {
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* For console ConfigKeyringHelper.
|
||||
* Persists immediately if removed.
|
||||
*
|
||||
* @param spk the unblinded public key
|
||||
* @return true if removed
|
||||
* @since 0.9.41
|
||||
*/
|
||||
public boolean removeBlindData(SigningPublicKey spk) {
|
||||
boolean rv = false;
|
||||
BlindData bd = _cache.remove(spk);
|
||||
if (bd != null) {
|
||||
rv = true;
|
||||
_reverseCache.remove(bd.getBlindedPubKey());
|
||||
Hash h = bd.getDestHash();
|
||||
if (h != null)
|
||||
_hashCache.remove(h);
|
||||
store();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load from file.
|
||||
* Format:
|
||||
|
@ -501,6 +501,16 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
|
||||
public List<BlindData> getBlindData() {
|
||||
return _blindCache.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* For console ConfigKeyringHelper
|
||||
* @param spk the unblinded public key
|
||||
* @return true if removed
|
||||
* @since 0.9.41
|
||||
*/
|
||||
public boolean removeBlindData(SigningPublicKey spk) {
|
||||
return _blindCache.removeBlindData(spk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RouterInfo, LeaseSet, or null, validated
|
||||
|
Reference in New Issue
Block a user