*Handle edge case if we have no responses
This commit is contained in:
parent
e6ec3cdc4c
commit
46f693a1f2
|
@ -37,6 +37,19 @@ export default class WisdomRpcQuery extends RpcQueryBase {
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!Object.keys(responses).length) {
|
||||||
|
if (Object.keys(this._errors).length) {
|
||||||
|
this.resolve({ error: Object.values(this._errors).pop() });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this._tries <= this._maxTries) {
|
||||||
|
this._tries++;
|
||||||
|
this.retry();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.resolve({ data: { error: ERR_MAX_TRIES_HIT } });
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (const responseHash in responses) {
|
for (const responseHash in responses) {
|
||||||
if (
|
if (
|
||||||
responses[responseHash] / responseStoreData.length >=
|
responses[responseHash] / responseStoreData.length >=
|
||||||
|
|
Loading…
Reference in New Issue