mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-12-02 11:54:05 +01:00
Add option to skip Tor send attempts in TorConfig (#453)
This commit is contained in:
@@ -257,6 +257,7 @@ pub struct SendArgs {
|
||||
pub target_slate_version: Option<u16>,
|
||||
pub payment_proof_address: Option<SlatepackAddress>,
|
||||
pub ttl_blocks: Option<u64>,
|
||||
pub skip_tor: bool,
|
||||
//TODO: Remove HF3
|
||||
pub output_v4_slate: bool,
|
||||
}
|
||||
@@ -450,6 +451,14 @@ where
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
let tor_config = match tor_config {
|
||||
Some(mut c) => {
|
||||
c.skip_send_attempt = Some(args.skip_tor);
|
||||
Some(c)
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
let res =
|
||||
try_slatepack_sync_workflow(&slate, &args.dest, tor_config, tor_sender, false, test_mode);
|
||||
|
||||
@@ -653,6 +662,7 @@ where
|
||||
pub struct ReceiveArgs {
|
||||
pub input_file: Option<String>,
|
||||
pub input_slatepack_message: Option<String>,
|
||||
pub skip_tor: bool,
|
||||
}
|
||||
|
||||
pub fn receive<L, C, K>(
|
||||
@@ -680,6 +690,14 @@ where
|
||||
Some(&m) => Some(m.to_owned()),
|
||||
};
|
||||
|
||||
let tor_config = match tor_config {
|
||||
Some(mut c) => {
|
||||
c.skip_send_attempt = Some(args.skip_tor);
|
||||
Some(c)
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
controller::foreign_single_use(owner_api.wallet_inst.clone(), km, |api| {
|
||||
slate = api.receive_tx(&slate, Some(&g_args.account), None)?;
|
||||
Ok(())
|
||||
@@ -962,6 +980,7 @@ pub struct ProcessInvoiceArgs {
|
||||
pub slate: Slate,
|
||||
pub estimate_selection_strategies: bool,
|
||||
pub ttl_blocks: Option<u64>,
|
||||
pub skip_tor: bool,
|
||||
}
|
||||
|
||||
/// Process invoice
|
||||
@@ -1036,6 +1055,14 @@ where
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
let tor_config = match tor_config {
|
||||
Some(mut c) => {
|
||||
c.skip_send_attempt = Some(args.skip_tor);
|
||||
Some(c)
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
let res = try_slatepack_sync_workflow(&slate, &dest, tor_config, None, true, test_mode);
|
||||
|
||||
match res {
|
||||
|
||||
Reference in New Issue
Block a user