Skip to content

Commit

Permalink
feat!: remove broadcastTalkReq (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Jan 19, 2024
1 parent 8d678c9 commit 1b70558
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions packages/discv5/src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,31 +403,6 @@ export class Discv5 extends (EventEmitter as { new (): Discv5EventEmitter }) {
});
}

/**
* Broadcast TALKREQ message to all nodes in routing table and returns response
*/
public async broadcastTalkReq(payload: Buffer, protocol: string | Uint8Array): Promise<Buffer> {
return await new Promise((resolve, reject) => {
const request = createTalkRequestMessage(payload, protocol);
const callback = (err: RequestErrorType | null, res: Buffer | null): void => {
if (err) {
return reject(err);
}
if (res) {
resolve(res);
}
};

/** Broadcast request to all peers in the routing table */
for (const node of this.kadValues()) {
this.sendRpcRequest({
contact: createNodeContact(node),
request,
callback,
});
}
});
}
/**
* Send TALKREQ message to dstId and returns response
*/
Expand Down

0 comments on commit 1b70558

Please sign in to comment.