diff --git a/packages/libp2p/src/libp2p.ts b/packages/libp2p/src/libp2p.ts index 612dac3692..b1f0e385a0 100644 --- a/packages/libp2p/src/libp2p.ts +++ b/packages/libp2p/src/libp2p.ts @@ -215,6 +215,8 @@ export class Libp2pNode> extends this.log('libp2p has started') } catch (err: any) { this.log.error('An error occurred starting libp2p', err) + // set status to 'started' so this.stop() will stop any running components + this.status = 'started' await this.stop() throw err }