*Use maybeGetAsyncProperty to get remotePublicKey

This commit is contained in:
Derrick Hammer 2023-03-25 10:51:29 -04:00
parent bb36a80913
commit 1cc1a0d2b1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -119,7 +119,9 @@ export default class RpcNetwork {
this.setupRelayPromise(); this.setupRelayPromise();
this._swarm.on("connection", async (relay: any) => { this._swarm.on("connection", async (relay: any) => {
const pubkey = b4a.from(relay.remotePublicKey).toString("hex"); const pubkey = b4a
.from(await maybeGetAsyncProperty(relay.remotePublicKey))
.toString("hex");
relay.once("close", () => { relay.once("close", () => {
this._methods.forEach((item) => { this._methods.forEach((item) => {
if (item.has(pubkey)) { if (item.has(pubkey)) {