Skip to content

Commit 0ee74f2

Browse files
committed
solving the bug ERR_PUTTING_TO_ROUTING on IPFS.name.publish
1 parent 6be5906 commit 0ee74f2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/ipfs-core/src/ipns/routing/dht-datastore.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,23 @@ export class DHTDatastore {
2424
*/
2525
async put (key, value, options) {
2626
try {
27-
await drain(this._dht.put(key, value, options))
27+
let responses = this._dht.put(key, value, options);
28+
while(true) {
29+
let item;
30+
try {
31+
item = await responses.next();
32+
} catch(e) {
33+
if (e.message != "Query aborted") throw e;
34+
}
35+
if (item && item.done) break;
36+
}
2837
} catch (/** @type {any} */ err) {
2938
log.error(err)
3039
throw err
3140
}
3241
}
3342

43+
3444
/**
3545
* @param {Uint8Array} key - identifier of the value to be obtained.
3646
* @param {AbortOptions} [options]

0 commit comments

Comments
 (0)