mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-08 22:42:35 -04:00
fix(asb): Allow history command to be run while asb is running (#82)
This applies the following PRs from upstream to our fork: * fix(asb): Allow history command to be run while asb is running (#1724) * Allow history command to be executed while asb is running by opening database in read-only mode (#1722) --------- Co-authored-by: einliterflasche <einliterflasche@pm.me> Co-authored-by: Einliterflasche <81313171+Einliterflasche@users.noreply.github.com>
This commit is contained in:
parent
34c97c59d9
commit
5bb33fe35d
6 changed files with 51 additions and 22 deletions
|
@ -17,7 +17,7 @@ use std::time::Duration;
|
|||
use swap::asb::FixedRate;
|
||||
use swap::bitcoin::{CancelTimelock, PunishTimelock, TxCancel, TxPunish, TxRedeem, TxRefund};
|
||||
use swap::cli::api;
|
||||
use swap::database::SqliteDatabase;
|
||||
use swap::database::{AccessMode, SqliteDatabase};
|
||||
use swap::env::{Config, GetConfig};
|
||||
use swap::fs::ensure_directory_exists;
|
||||
use swap::network::rendezvous::XmrBtcNamespace;
|
||||
|
@ -232,7 +232,11 @@ async fn start_alice(
|
|||
if !&db_path.exists() {
|
||||
tokio::fs::File::create(&db_path).await.unwrap();
|
||||
}
|
||||
let db = Arc::new(SqliteDatabase::open(db_path.as_path()).await.unwrap());
|
||||
let db = Arc::new(
|
||||
SqliteDatabase::open(db_path.as_path(), AccessMode::ReadWrite)
|
||||
.await
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
let min_buy = bitcoin::Amount::from_sat(u64::MIN);
|
||||
let max_buy = bitcoin::Amount::from_sat(u64::MAX);
|
||||
|
@ -434,7 +438,7 @@ impl BobParams {
|
|||
if !self.db_path.exists() {
|
||||
tokio::fs::File::create(&self.db_path).await?;
|
||||
}
|
||||
let db = Arc::new(SqliteDatabase::open(&self.db_path).await?);
|
||||
let db = Arc::new(SqliteDatabase::open(&self.db_path, AccessMode::ReadWrite).await?);
|
||||
|
||||
let (event_loop, handle) = self.new_eventloop(swap_id, db.clone()).await?;
|
||||
|
||||
|
@ -464,7 +468,7 @@ impl BobParams {
|
|||
if !self.db_path.exists() {
|
||||
tokio::fs::File::create(&self.db_path).await?;
|
||||
}
|
||||
let db = Arc::new(SqliteDatabase::open(&self.db_path).await?);
|
||||
let db = Arc::new(SqliteDatabase::open(&self.db_path, AccessMode::ReadWrite).await?);
|
||||
|
||||
let (event_loop, handle) = self.new_eventloop(swap_id, db.clone()).await?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue