diff --git a/src/query/wisdom.ts b/src/query/wisdom.ts index 3bfd002..fd0572a 100644 --- a/src/query/wisdom.ts +++ b/src/query/wisdom.ts @@ -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) { if ( responses[responseHash] / responseStoreData.length >=