Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

solving the bug ERR_PUTTING_TO_ROUTING on IPFS.name.publish #4268

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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