Merge pull request #940 from waku-org/ignored-promise

This commit is contained in:
fryorcraken.eth 2022-09-11 00:32:06 +10:00 committed by GitHub
commit 70547db2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- `addPeerToAddressBook` is now async.
## [0.26.0] - 2022-09-08
### Added

View File

@ -143,10 +143,10 @@ export class WakuNode implements Waku {
/**
* Add peer to address book, it will be auto-dialed in the background.
*/
addPeerToAddressBook(
async addPeerToAddressBook(
peerId: PeerId | string,
multiaddrs: Multiaddr[] | string[]
): void {
): Promise<void> {
let peer;
if (typeof peerId === "string") {
peer = peerIdFromString(peerId);
@ -160,7 +160,7 @@ export class WakuNode implements Waku {
return addr;
}
});
this.libp2p.peerStore.addressBook.set(peer, addresses);
await this.libp2p.peerStore.addressBook.set(peer, addresses);
}
async start(): Promise<void> {