patch wallet already open error

This commit is contained in:
creating2morrow 2023-11-02 02:42:10 -04:00
parent 27507a659c
commit 43ab8bbb28
2 changed files with 5 additions and 3 deletions

View file

@ -69,6 +69,7 @@ pub async fn create(j_order: Json<reqres::OrderRequest>) -> Order {
return Default::default();
}
// enable multisig
monero::close_wallet(&orid, &wallet_password).await;
monero::enable_experimental_multisig(&orid);
debug!("insert order: {:?}", &new_order);
let s = db::Interface::open();
@ -83,7 +84,6 @@ pub async fn create(j_order: Json<reqres::OrderRequest>) -> Order {
let order_list = [r, String::from(&orid)].join(",");
debug!("writing order index {} for id: {}", order_list, list_key);
db::Interface::write(&s.env, &s.handle, &String::from(list_key), &order_list);
monero::close_wallet(&orid, &wallet_password).await;
new_order
}
@ -376,5 +376,6 @@ pub async fn init_mediator_wallet(orid: &String) {
log::error!("failed to create mediator wallet");
}
// enable multisig
monero::close_wallet(&orid, &password).await;
monero::enable_experimental_multisig(&orid);
}

View file

@ -1419,9 +1419,10 @@ fn send_prepare_info_req(
return;
}
// enable multisig
monero::enable_experimental_multisig(&w_orid);
let prepare_info = monero::prepare_wallet().await;
monero::close_wallet(&w_orid, &wallet_password).await;
monero::enable_experimental_multisig(&w_orid);
monero::open_wallet(&w_orid, &wallet_password).await;
let prepare_info = monero::prepare_wallet().await;
let ref_prepare_info: &String = &prepare_info.result.multisig_info;
utils::write_gui_db(
String::from(crate::GUI_MSIG_PREPARE_DB_KEY),