mirror of https://github.com/status-im/js-waku.git
Merge pull request #940 from waku-org/ignored-promise
This commit is contained in:
commit
70547db2be
|
@ -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
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in New Issue