Skip to content

Commit

Permalink
solving the bug ERR_PUTTING_TO_ROUTING on IPFS.name.publish
Browse files Browse the repository at this point in the history
  • Loading branch information
algorista committed Dec 15, 2022
1 parent 6be5906 commit 0ee74f2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/ipfs-core/src/ipns/routing/dht-datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

1 comment on commit 0ee74f2

@algorista
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue ipfs#4267

Please sign in to comment.