*Add peerHasItem method
This commit is contained in:
parent
eab1d70df4
commit
24b97d5288
|
@ -89,6 +89,13 @@ export default class DHTCache extends EventEmitter {
|
||||||
return items.sort();
|
return items.sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public peerHasItem(peer: string | Buffer, item: string | Buffer): boolean {
|
||||||
|
peer = this._maybeHexify(peer);
|
||||||
|
item = this._maybeHexify(item);
|
||||||
|
|
||||||
|
return this.graph.hasSuccessor(peer, item);
|
||||||
|
}
|
||||||
|
|
||||||
public addItem(item: string | Buffer) {
|
public addItem(item: string | Buffer) {
|
||||||
item = this._maybeHexify(item);
|
item = this._maybeHexify(item);
|
||||||
this._cache.add(item);
|
this._cache.add(item);
|
||||||
|
|
Loading…
Reference in New Issue