*Remove unneeded return

This commit is contained in:
Derrick Hammer 2022-09-09 22:24:18 -04:00
parent 3d52e6fd7b
commit 4478eb3a23
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 3 additions and 11 deletions

View File

@ -25,7 +25,6 @@ export default class SimpleRpcQuery extends RpcQueryBase {
if (Object.keys(this._errors).length) {
const error = Object.values(this._errors).pop();
this.resolve(error, error === "timeout");
return;
}
}

View File

@ -46,8 +46,6 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
return;
}
return new Promise((resolve, reject) => {
let timer: any;
const finish = () => {
relay = relay as string;
this._responses[relay] = {};
@ -57,10 +55,9 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
const listener = (res: Buffer) => {
relay = relay as string;
if (timer) {
clearTimeout(timer as any);
timer = null;
clearTimeout(this._timeoutTimer);
if (this._timeoutTimer) {
clearTimeout(this._timeoutTimer as any);
this._timeoutTimer = null;
}
if (this._canceled) {
@ -92,10 +89,6 @@ export default class StreamingRpcQuery extends SimpleRpcQuery {
});
socket.write("rpc");
socket.write(pack(this._query));
timer = setTimeout(() => {
this._errors[relay as string] = "timeout";
reject(null);
}, (this._options.relayTimeout || this._network.relayTimeout) * 1000) as NodeJS.Timeout;
});
}
}