diff --git a/packages/ipfs-core/src/ipns/routing/dht-datastore.js b/packages/ipfs-core/src/ipns/routing/dht-datastore.js index 62b08eadff..9d2bb17ea2 100644 --- a/packages/ipfs-core/src/ipns/routing/dht-datastore.js +++ b/packages/ipfs-core/src/ipns/routing/dht-datastore.js @@ -24,13 +24,23 @@ export class DHTDatastore { */ async put (key, value, options) { try { - await drain(this._dht.put(key, value, options)) + let responses = this._dht.put(key, value, options); + while(true) { + let item; + try { + item = await responses.next(); + } catch(e) { + if (e.message != "Query aborted") throw e; + } + if (item && item.done) break; + } } catch (/** @type {any} */ err) { log.error(err) throw err } } + /** * @param {Uint8Array} key - identifier of the value to be obtained. * @param {AbortOptions} [options]