*Switch from Buffer to hexToBuf

This commit is contained in:
Derrick Hammer 2022-08-13 15:11:18 -04:00
parent 77c473611a
commit 4e4a22542f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,8 @@ import type { ActiveQuery } from "libkmodule";
import { addHandler, getSeed, handleMessage } from "libkmodule";
import { handlePresentSeed as handlePresentSeedModule } from "libkmodule/dist/seed.js";
import { nextId } from "./id";
import { Buffer } from "buffer";
import type { Buffer } from "buffer";
import {hexToBuf} from "libskynet";
interface DhtConnection {
dht: number;
@ -89,7 +90,7 @@ async function handleConnect(aq: ActiveQuery) {
try {
// @ts-ignore
socket = await dht.connect(
typeof pubkey === "string" ? Buffer.from(pubkey, "hex") : pubkey,
typeof pubkey === "string" ? hexToBuf(pubkey) : pubkey,
options
);
} catch (e: any) {