*getNodeQuery is not needed, for now

This commit is contained in:
Derrick Hammer 2022-11-27 18:12:28 -05:00
parent 364e628c7a
commit 8895f557e5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 0 additions and 25 deletions

View File

@ -40,31 +40,6 @@ export class RPCCache extends EventEmitter {
}); });
} }
public async getNodeQuery(
node: string,
queryHash: string
): Promise<boolean | RPCResponse> {
if (!this.dhtCache?.peerHasItem(node, queryHash)) {
return false;
}
const rpc = await getRpcByPeer(node);
let response;
try {
response = rpc.request("rpc.get_cached_item", queryHash) as RPCCacheItem;
} catch (e: any) {
return false;
}
if (!this.verifyResponse(b4a.from(node, "hex") as Buffer, response)) {
return false;
}
return { ...response?.value };
}
public signResponse(item: RPCCacheItem): string { public signResponse(item: RPCCacheItem): string {
const field = item.value.signedField || "data"; const field = item.value.signedField || "data";
const updated = item.value.updated; const updated = item.value.updated;