mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Init db after tracing
This commit is contained in:
parent
f91d8ab45c
commit
8fb15ba7aa
@ -55,8 +55,6 @@ async fn main() -> Result<()> {
|
||||
}
|
||||
};
|
||||
|
||||
let db = open_db(data_dir.join("database"), data_dir.join("sqlite"), sled).await?;
|
||||
|
||||
match cmd {
|
||||
Command::BuyXmr {
|
||||
seller,
|
||||
@ -70,6 +68,7 @@ async fn main() -> Result<()> {
|
||||
let swap_id = Uuid::new_v4();
|
||||
|
||||
cli::tracing::init(debug, json, data_dir.join("logs"), Some(swap_id))?;
|
||||
let db = open_db(data_dir.join("database"), data_dir.join("sqlite"), sled).await?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
.context("Failed to read in seed file")?;
|
||||
|
||||
@ -84,7 +83,6 @@ async fn main() -> Result<()> {
|
||||
let (monero_wallet, _process) =
|
||||
init_monero_wallet(data_dir, monero_daemon_address, env_config).await?;
|
||||
let bitcoin_wallet = Arc::new(bitcoin_wallet);
|
||||
|
||||
let seller_peer_id = seller
|
||||
.extract_peer_id()
|
||||
.context("Seller address must contain peer ID")?;
|
||||
@ -141,6 +139,7 @@ async fn main() -> Result<()> {
|
||||
}
|
||||
}
|
||||
Command::History => {
|
||||
let db = open_db(data_dir.join("database"), data_dir.join("sqlite"), sled).await?;
|
||||
let mut table = Table::new();
|
||||
|
||||
table.set_header(vec!["SWAP ID", "STATE"]);
|
||||
@ -245,6 +244,7 @@ async fn main() -> Result<()> {
|
||||
tor_socks5_port,
|
||||
} => {
|
||||
cli::tracing::init(debug, json, data_dir.join("logs"), Some(swap_id))?;
|
||||
let db = open_db(data_dir.join("database"), data_dir.join("sqlite"), sled).await?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
.context("Failed to read in seed file")?;
|
||||
|
||||
@ -306,6 +306,7 @@ async fn main() -> Result<()> {
|
||||
bitcoin_target_block,
|
||||
} => {
|
||||
cli::tracing::init(debug, json, data_dir.join("logs"), Some(swap_id))?;
|
||||
let db = open_db(data_dir.join("database"), data_dir.join("sqlite"), sled).await?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
.context("Failed to read in seed file")?;
|
||||
|
||||
@ -327,6 +328,7 @@ async fn main() -> Result<()> {
|
||||
bitcoin_target_block,
|
||||
} => {
|
||||
cli::tracing::init(debug, json, data_dir.join("logs"), Some(swap_id))?;
|
||||
let db = open_db(data_dir.join("database"), data_dir.join("sqlite"), sled).await?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
.context("Failed to read in seed file")?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user