From 92fe42c37e8faa57262b79cd3124410e2e6b6e73 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 19 Mar 2023 15:11:13 -0400 Subject: [PATCH] *Return the relay object, not the pubkey --- src/network.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network.ts b/src/network.ts index bc0a23b..3521a3a 100644 --- a/src/network.ts +++ b/src/network.ts @@ -99,7 +99,9 @@ export default class RpcNetwork { throw Error("no available relay"); } - return Array.from(relays)[Math.floor(Math.random() * relays.size)]; + return this._relays.get( + Array.from(relays)[Math.floor(Math.random() * relays.size)] + ); } public getRelay(pubkey: string) {