浏览代码

taud: Cleanly stop p2p network on term signal.

parazyd 3 年之前
父节点
当前提交
232cc174cf
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 1
      Makefile
  2. 2 0
      bin/tau/taud/src/main.rs

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ CARGO = cargo +nightly
 #TARGET_PRFX = --target=
 
 # Binaries to be built
-BINS = darkfid faucetd drk darkirc dnetview vanityaddr
+BINS = darkfid faucetd drk darkirc dnetview vanityaddr tau taud
 
 # zkas dependencies
 ZKASDEPS = \

+ 2 - 0
bin/tau/taud/src/main.rs

@@ -399,5 +399,7 @@ async fn realmain(settings: Args, executor: Arc<smol::Executor<'_>>) -> Result<(
     print!("\r");
     info!("Caught termination signal, cleaning up and exiting...");
 
+    p2p.stop().await;
+
     Ok(())
 }