Skip to content

Commit c64c3ce

Browse files
committed
Call stop() on Drop to allow for cleaner shutdown
1 parent bc7a4ba commit c64c3ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,12 @@ impl Node {
14401440
}
14411441
}
14421442

1443+
impl Drop for Node {
1444+
fn drop(&mut self) {
1445+
let _ = self.stop();
1446+
}
1447+
}
1448+
14431449
async fn connect_peer_if_necessary(
14441450
pubkey: PublicKey, peer_addr: SocketAddr, peer_manager: Arc<PeerManager>,
14451451
logger: Arc<FilesystemLogger>,

0 commit comments

Comments
 (0)