*Buffer conversion bugfix
This commit is contained in:
parent
77d72a6666
commit
cb2299f9e8
|
@ -21,7 +21,9 @@ export async function start() {
|
||||||
|
|
||||||
export async function getRpcByPeer(peer: Buffer | string) {
|
export async function getRpcByPeer(peer: Buffer | string) {
|
||||||
const swarm = getSwarm();
|
const swarm = getSwarm();
|
||||||
peer = b4a.from(peer) as Buffer;
|
if (!b4a.isBuffer(peer)) {
|
||||||
|
peer = b4a.from(peer, "hex") as Buffer;
|
||||||
|
}
|
||||||
|
|
||||||
if (swarm._allConnections.has(peer)) {
|
if (swarm._allConnections.has(peer)) {
|
||||||
return swarm._allConnections.get(peer)[RPC_PROTOCOL_SYMBOL];
|
return swarm._allConnections.get(peer)[RPC_PROTOCOL_SYMBOL];
|
||||||
|
|
Loading…
Reference in New Issue