* PersistentDataStore: Don't try to remove nonexistent leaseSet files
This commit is contained in:
@ -18,6 +18,7 @@ public interface DataStore {
|
|||||||
public DataStructure get(Hash key);
|
public DataStructure get(Hash key);
|
||||||
public void put(Hash key, DataStructure data);
|
public void put(Hash key, DataStructure data);
|
||||||
public DataStructure remove(Hash key);
|
public DataStructure remove(Hash key);
|
||||||
|
public DataStructure removeLease(Hash key);
|
||||||
public Set getKeys();
|
public Set getKeys();
|
||||||
public void restart();
|
public void restart();
|
||||||
public int countLeaseSets();
|
public int countLeaseSets();
|
||||||
|
@ -783,7 +783,10 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
|
|||||||
// if we dont know the key, lets make sure it isn't a now-dead peer
|
// if we dont know the key, lets make sure it isn't a now-dead peer
|
||||||
}
|
}
|
||||||
|
|
||||||
_ds.remove(dbEntry);
|
if (isRouterInfo)
|
||||||
|
_ds.remove(dbEntry);
|
||||||
|
else
|
||||||
|
_ds.removeLease(dbEntry);
|
||||||
synchronized (_lastSent) {
|
synchronized (_lastSent) {
|
||||||
_lastSent.remove(dbEntry);
|
_lastSent.remove(dbEntry);
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,10 @@ class PersistentDataStore extends TransientDataStore {
|
|||||||
return super.remove(key);
|
return super.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DataStructure removeLease(Hash key) {
|
||||||
|
return super.removeLease(key);
|
||||||
|
}
|
||||||
|
|
||||||
public void put(Hash key, DataStructure data) {
|
public void put(Hash key, DataStructure data) {
|
||||||
if ( (data == null) || (key == null) ) return;
|
if ( (data == null) || (key == null) ) return;
|
||||||
super.put(key, data);
|
super.put(key, data);
|
||||||
|
@ -163,6 +163,10 @@ class TransientDataStore implements DataStore {
|
|||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DataStructure removeLease(Hash key) {
|
||||||
|
return remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
public DataStructure remove(Hash key) {
|
public DataStructure remove(Hash key) {
|
||||||
synchronized (_data) {
|
synchronized (_data) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
|
Reference in New Issue
Block a user