@@ -29,7 +29,7 @@ use swap::asb::config::{
29
29
} ;
30
30
use swap:: asb:: { cancel, punish, redeem, refund, safely_abort, EventLoop , Finality , KrakenRate } ;
31
31
use swap:: common:: tracing_util:: Format ;
32
- use swap:: common:: { self , check_latest_version , get_logs } ;
32
+ use swap:: common:: { self , get_logs , warn_if_outdated } ;
33
33
use swap:: database:: { open_db, AccessMode } ;
34
34
use swap:: network:: rendezvous:: XmrBtcNamespace ;
35
35
use swap:: network:: swarm;
@@ -63,12 +63,10 @@ pub async fn main() -> Result<()> {
63
63
}
64
64
} ;
65
65
66
- // warn if we're not on the latest version
67
- if let Err ( e) = check_latest_version ( env ! ( "CARGO_PKG_VERSION" ) ) . await {
68
- eprintln ! ( "{}" , e) ;
69
- }
66
+ // Check in the background if there's a new version available
67
+ tokio:: spawn ( async move { warn_if_outdated ( env ! ( "CARGO_PKG_VERSION" ) ) . await } ) ;
70
68
71
- // read config from the specified path
69
+ // Read config from the specified path
72
70
let config = match read_config ( config_path. clone ( ) ) ? {
73
71
Ok ( config) => config,
74
72
Err ( ConfigNotInitialized { } ) => {
@@ -77,13 +75,13 @@ pub async fn main() -> Result<()> {
77
75
}
78
76
} ;
79
77
80
- // initialize tracing
78
+ // Initialize tracing
81
79
let format = if json { Format :: Json } else { Format :: Raw } ;
82
80
let log_dir = config. data . dir . join ( "logs" ) ;
83
81
common:: tracing_util:: init ( LevelFilter :: DEBUG , format, log_dir, None )
84
82
. expect ( "initialize tracing" ) ;
85
83
86
- // check for conflicting env / config values
84
+ // Check for conflicting env / config values
87
85
if config. monero . network != env_config. monero_network {
88
86
bail ! ( format!(
89
87
"Expected monero network in config file to be {:?} but was {:?}" ,
@@ -118,12 +116,12 @@ pub async fn main() -> Result<()> {
118
116
) ;
119
117
}
120
118
121
- // initialize monero wallet
119
+ // Initialize Monero wallet
122
120
let monero_wallet = init_monero_wallet ( & config, env_config) . await ?;
123
121
let monero_address = monero_wallet. get_main_address ( ) ;
124
122
tracing:: info!( %monero_address, "Monero wallet address" ) ;
125
123
126
- // check monero balance
124
+ // Check Monero balance
127
125
let monero = monero_wallet. get_balance ( ) . await ?;
128
126
match ( monero. balance , monero. unlocked_balance ) {
129
127
( 0 , _) => {
@@ -146,14 +144,14 @@ pub async fn main() -> Result<()> {
146
144
}
147
145
}
148
146
149
- // init bitcoin wallet
147
+ // Initialize Bitcoin wallet
150
148
let bitcoin_wallet = init_bitcoin_wallet ( & config, & seed, env_config) . await ?;
151
149
let bitcoin_balance = bitcoin_wallet. balance ( ) . await ?;
152
150
tracing:: info!( %bitcoin_balance, "Bitcoin wallet balance" ) ;
153
151
154
152
let kraken_price_updates = kraken:: connect ( config. maker . price_ticker_ws_url . clone ( ) ) ?;
155
153
156
- // setup Tor hidden services
154
+ // Setup Tor hidden services
157
155
let tor_client =
158
156
tor:: Client :: new ( config. tor . socks5_port ) . with_control_port ( config. tor . control_port ) ;
159
157
let _ac = match tor_client. assert_tor_running ( ) . await {
0 commit comments