Changeset f049319 for router


Ignore:
Timestamp:
May 30, 2019 2:26:11 PM (10 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
aae81a7b
Parents:
6b3896c
Message:

Console: Support deleting blinded entries on /configkeyring

Location:
router/java/src/net/i2p/router
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/NetworkDatabaseFacade.java

    r6b3896c rf049319  
    188188        return null;
    189189    }
     190
     191    /**
     192     *  For console ConfigKeyringHelper
     193     *  @return true if removed
     194     *  @since 0.9.41
     195     */
     196    public boolean removeBlindData(SigningPublicKey spk) {
     197        return false;
     198    }
    190199}
  • router/java/src/net/i2p/router/networkdb/kademlia/BlindCache.java

    r6b3896c rf049319  
    247247        List<BlindData> rv = new ArrayList<BlindData>(_cache.size());
    248248        rv.addAll(_cache.values());
     249        return rv;
     250    }
     251
     252    /**
     253     *  For console ConfigKeyringHelper.
     254     *  Persists immediately if removed.
     255     *
     256     *  @param spk the unblinded public key
     257     *  @return true if removed
     258     *  @since 0.9.41
     259     */
     260    public boolean removeBlindData(SigningPublicKey spk) {
     261        boolean rv = false;
     262        BlindData bd = _cache.remove(spk);
     263        if (bd != null) {
     264            rv = true;
     265            _reverseCache.remove(bd.getBlindedPubKey());
     266            Hash h = bd.getDestHash();
     267            if (h != null)
     268                _hashCache.remove(h);
     269            store();
     270        }
    249271        return rv;
    250272    }
  • router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

    r6b3896c rf049319  
    501501    public List<BlindData> getBlindData() {
    502502        return _blindCache.getData();
     503    }
     504
     505    /**
     506     *  For console ConfigKeyringHelper
     507     *  @param spk the unblinded public key
     508     *  @return true if removed
     509     *  @since 0.9.41
     510     */
     511    public boolean removeBlindData(SigningPublicKey spk) {
     512        return _blindCache.removeBlindData(spk);
    503513    }
    504514   
Note: See TracChangeset for help on using the changeset viewer.