File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1758,9 +1758,7 @@ export class GossipSub extends EventEmitter<GossipsubEvents> implements PubSub<G
1758
1758
}
1759
1759
}
1760
1760
1761
- this . leave ( topic ) . catch ( ( err ) => {
1762
- this . log ( err )
1763
- } )
1761
+ this . leave ( topic )
1764
1762
}
1765
1763
1766
1764
/**
@@ -1834,7 +1832,7 @@ export class GossipSub extends EventEmitter<GossipsubEvents> implements PubSub<G
1834
1832
/**
1835
1833
* Leave topic
1836
1834
*/
1837
- private async leave ( topic : TopicStr ) : Promise < void > {
1835
+ private leave ( topic : TopicStr ) : void {
1838
1836
if ( this . status . code !== GossipStatusCode . started ) {
1839
1837
throw new Error ( 'Gossipsub has not started' )
1840
1838
}
@@ -1845,12 +1843,14 @@ export class GossipSub extends EventEmitter<GossipsubEvents> implements PubSub<G
1845
1843
// Send PRUNE to mesh peers
1846
1844
const meshPeers = this . mesh . get ( topic )
1847
1845
if ( meshPeers ) {
1848
- await Promise . all (
1846
+ Promise . all (
1849
1847
Array . from ( meshPeers ) . map ( async ( id ) => {
1850
1848
this . log ( 'LEAVE: Remove mesh link to %s in %s' , id , topic )
1851
1849
return await this . sendPrune ( id , topic )
1852
1850
} )
1853
- )
1851
+ ) . catch ( ( err ) => {
1852
+ this . log ( 'Error sending prunes to mesh peers' , err )
1853
+ } )
1854
1854
this . mesh . delete ( topic )
1855
1855
}
1856
1856
}
You can’t perform that action at this time.
0 commit comments