diff --git a/src/messages/storageLocation.ts b/src/messages/storageLocation.ts index 724a1de..b9b35af 100644 --- a/src/messages/storageLocation.ts +++ b/src/messages/storageLocation.ts @@ -57,7 +57,8 @@ export default async function ( config: node.config, }); - const list = p2p.hashQueryRoutingTable.get(hash) || new Set(); + const list = + node.hashQueryRoutingTable.get(hash.hashCode) || new Set(); for (const peerId of list) { if (peerId.equals(nodeId)) { continue; @@ -74,5 +75,5 @@ export default async function ( } } } - p2p.hashQueryRoutingTable.delete(hash); + node.hashQueryRoutingTable.delete(hash.hashCode); } diff --git a/src/node.ts b/src/node.ts index 7c127b5..90b7e39 100644 --- a/src/node.ts +++ b/src/node.ts @@ -50,6 +50,12 @@ export class S5Node { private _started = false; + private _hashQueryRoutingTable: Map> = new Map(); + + get hashQueryRoutingTable(): Map> { + return this._hashQueryRoutingTable; + } + get started(): boolean { return this._started; } diff --git a/src/service/p2p.ts b/src/service/p2p.ts index ae83b6d..75b5777 100644 --- a/src/service/p2p.ts +++ b/src/service/p2p.ts @@ -48,13 +48,6 @@ export class P2PService extends EventEmitter { node.services.p2p = this; } - - private _hashQueryRoutingTable: Map> = new Map(); - - get hashQueryRoutingTable(): Map> { - return this._hashQueryRoutingTable; - } - private _networkId?: string; get networkId(): string {