enable experimental multisig on wallet creation

This commit is contained in:
creating2morrow 2023-10-07 06:57:10 -04:00
parent 30f181946f
commit a94718ed75
6 changed files with 26 additions and 2 deletions

View file

@ -1383,3 +1383,20 @@ pub async fn p_get_transactions(
Err(_) => Ok(Default::default()),
}
}
/// enable multisig - `monero-wallet-cli --password <> --wallet-file <> set enable-multisig-experimental 1`
pub fn enable_experimental_multisig(wallet_file: &String) {
let bin_dir = get_monero_location();
let wallet_password =
std::env::var(crate::MONERO_WALLET_PASSWORD).unwrap_or(String::from("password"));
let args = vec![
"--password", &wallet_password,
"--wallet-file", &wallet_file,
"set", "enable-mulitsig-experimental", "1"
];
let output = Command::new(format!("{}/monero-wallet-cli", bin_dir))
.args(args)
.spawn()
.expect("failed to enable experimental msig");
debug!("{:?}", output.stdout);
}

View file

@ -68,6 +68,8 @@ pub async fn create(j_order: Json<reqres::OrderRequest>) -> Order {
monero::close_wallet(&orid, &wallet_password).await;
return Default::default();
}
// enable multisig
monero::enable_experimental_multisig(&orid);
debug!("insert order: {:?}", &new_order);
let s = db::Interface::open();
let k = &new_order.orid;
@ -373,4 +375,6 @@ pub async fn init_mediator_wallet(orid: &String) {
if !m_wallet {
log::error!("failed to create mediator wallet");
}
// enable multisig
monero::enable_experimental_multisig(&orid);
}

View file

@ -528,6 +528,7 @@ fn start_gui() {
/// Put all app pre-checks here
pub async fn start_up() {
info!("neveko is starting up");
warn!("monero multising is experimental and usage of neveko may lead to loss of funds");
let args = args::Args::parse();
if args.remote_access {
start_micro_servers();

View file

@ -1418,6 +1418,8 @@ fn send_prepare_info_req(
let _ = tx.send(utils::empty_string());
return;
}
// enable multisig
monero::enable_experimental_multisig(&w_orid);
let prepare_info = monero::prepare_wallet().await;
monero::close_wallet(&w_orid, &wallet_password).await;
let ref_prepare_info: &String = &prepare_info.result.multisig_info;