diff --git a/dist/index.d.ts b/dist/index.d.ts index 62aa0a2..696ee7b 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -8,5 +8,6 @@ export declare class PeerDiscovery { private _sources; registerSource(name: string, source: PeerSource): boolean; removeSource(name: string): boolean; + removeAllSources(): void; discover(pubkey: string | Buffer, options?: {}): Promise; } diff --git a/dist/index.js b/dist/index.js index f199920..48758de 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21,6 +21,9 @@ class PeerDiscovery { this._sources.delete(name); return true; } + removeAllSources() { + this._sources.clear(); + } async discover(pubkey, options = {}) { if (!b4a_1.default.isBuffer(pubkey)) { pubkey = b4a_1.default.from(pubkey, "hex");