1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::imports::*;

#[derive(Default, Handler)]
#[help("Stop local node and close wallet")]
pub struct Stop;

impl Stop {
    async fn main(self: Arc<Self>, ctx: &Arc<dyn Context>, _argv: Vec<String>, _cmd: &str) -> Result<()> {
        ctx.term().exec("wallet close").await?;
        ctx.term().exec("disconnect").await?;
        ctx.term().exec("node stop").await?;

        Ok(())
    }
}