mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-12-22 19:49:24 +00:00
enable experimental multisig on wallet creation
This commit is contained in:
parent
30f181946f
commit
a94718ed75
6 changed files with 26 additions and 2 deletions
|
@ -1383,3 +1383,20 @@ pub async fn p_get_transactions(
|
||||||
Err(_) => Ok(Default::default()),
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -68,6 +68,8 @@ pub async fn create(j_order: Json<reqres::OrderRequest>) -> Order {
|
||||||
monero::close_wallet(&orid, &wallet_password).await;
|
monero::close_wallet(&orid, &wallet_password).await;
|
||||||
return Default::default();
|
return Default::default();
|
||||||
}
|
}
|
||||||
|
// enable multisig
|
||||||
|
monero::enable_experimental_multisig(&orid);
|
||||||
debug!("insert order: {:?}", &new_order);
|
debug!("insert order: {:?}", &new_order);
|
||||||
let s = db::Interface::open();
|
let s = db::Interface::open();
|
||||||
let k = &new_order.orid;
|
let k = &new_order.orid;
|
||||||
|
@ -373,4 +375,6 @@ pub async fn init_mediator_wallet(orid: &String) {
|
||||||
if !m_wallet {
|
if !m_wallet {
|
||||||
log::error!("failed to create mediator wallet");
|
log::error!("failed to create mediator wallet");
|
||||||
}
|
}
|
||||||
|
// enable multisig
|
||||||
|
monero::enable_experimental_multisig(&orid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -528,6 +528,7 @@ fn start_gui() {
|
||||||
/// Put all app pre-checks here
|
/// Put all app pre-checks here
|
||||||
pub async fn start_up() {
|
pub async fn start_up() {
|
||||||
info!("neveko is starting 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();
|
let args = args::Args::parse();
|
||||||
if args.remote_access {
|
if args.remote_access {
|
||||||
start_micro_servers();
|
start_micro_servers();
|
||||||
|
|
|
@ -1418,6 +1418,8 @@ fn send_prepare_info_req(
|
||||||
let _ = tx.send(utils::empty_string());
|
let _ = tx.send(utils::empty_string());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// enable multisig
|
||||||
|
monero::enable_experimental_multisig(&w_orid);
|
||||||
let prepare_info = monero::prepare_wallet().await;
|
let prepare_info = monero::prepare_wallet().await;
|
||||||
monero::close_wallet(&w_orid, &wallet_password).await;
|
monero::close_wallet(&w_orid, &wallet_password).await;
|
||||||
let ref_prepare_info: &String = &prepare_info.result.multisig_info;
|
let ref_prepare_info: &String = &prepare_info.result.multisig_info;
|
||||||
|
|
Loading…
Reference in a new issue