*add getter to return relay servers

This commit is contained in:
Derrick Hammer 2022-08-14 07:25:16 -04:00
parent 8c30190a78
commit 5276de4363
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ export default class DHT {
return [...this._relays.keys()]; return [...this._relays.keys()];
} }
get relayServers(): string[] {
return [...this._relays.values()];
}
public async addRelay(pubkey: string): Promise<boolean> { public async addRelay(pubkey: string): Promise<boolean> {
let entry: errTuple = await registryRead( let entry: errTuple = await registryRead(
hexToBuf(pubkey).shift() as Uint8Array, hexToBuf(pubkey).shift() as Uint8Array,