From 56bb5007f6aa49d3a9424e7e6f71a0f8ca356987 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 31 Aug 2023 02:30:19 -0400 Subject: [PATCH] refactor: add registry message handling back in --- src/service/p2p.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/service/p2p.ts b/src/service/p2p.ts index f9000a4..9a7752d 100644 --- a/src/service/p2p.ts +++ b/src/service/p2p.ts @@ -11,6 +11,7 @@ import { protocolMethodHandshakeOpen, protocolMethodHashQuery, protocolMethodSignedMessage, + recordTypeRegistryEntry, recordTypeStorageLocation, storageLocationTypeFull, } from "../constants.js"; @@ -111,11 +112,12 @@ export class P2PService { // p.packInt(protocolVersion); peer.sendMessage(await this.signMessageSimple(p.takeBytes())); return; - } /*else if (method === recordTypeRegistryEntry) { - const sre = node.registry.deserializeRegistryEntry(event); - await node.registry.set(sre, { receivedFrom: peer }); + } else if (method === recordTypeRegistryEntry) { + const sre = + this.config.services.registry.deserializeRegistryEntry(event); + await this.config.services.registry.set(sre, false, peer); return; - }*/ else if (method === recordTypeStorageLocation) { + } else if (method === recordTypeStorageLocation) { const hash = new Multihash(event.subarray(1, 34)); const type = event[34]; const expiry = decodeEndian(event.subarray(35, 39));