TOR bridge + TOR Proxy + migration config_file_version (#617)

* tor bridge config and args

* migration `config_file_version=2`

* small fixes typo, comment etc..

* support: snowflake, meek_lite, obsf4 and tor proxy

* remove useless serde

* improve migrate function

* few fixes

* add bridge flags to pay and receive + few fixes

* some improvements
This commit is contained in:
deevope
2022-02-03 15:33:41 +00:00
committed by GitHub
parent f5dbed2014
commit c424a0ed10
18 changed files with 1338 additions and 41 deletions
+12
View File
@@ -334,6 +334,7 @@ pub struct SendArgs {
pub ttl_blocks: Option<u64>,
pub skip_tor: bool,
pub outfile: Option<String>,
pub bridge: Option<String>,
}
pub fn send<L, C, K>(
@@ -412,6 +413,9 @@ where
let tor_config = match tor_config {
Some(mut c) => {
if let Some(b) = args.bridge.clone() {
c.bridge.bridge_line = Some(b);
}
c.skip_send_attempt = Some(args.skip_tor);
Some(c)
}
@@ -605,6 +609,7 @@ pub struct ReceiveArgs {
pub input_slatepack_message: Option<String>,
pub skip_tor: bool,
pub outfile: Option<String>,
pub bridge: Option<String>,
}
pub fn receive<L, C, K>(
@@ -634,6 +639,9 @@ where
let tor_config = match tor_config {
Some(mut c) => {
if let Some(b) = args.bridge {
c.bridge.bridge_line = Some(b);
}
c.skip_send_attempt = Some(args.skip_tor);
Some(c)
}
@@ -889,6 +897,7 @@ pub struct ProcessInvoiceArgs {
pub ttl_blocks: Option<u64>,
pub skip_tor: bool,
pub outfile: Option<String>,
pub bridge: Option<String>,
}
/// Process invoice
@@ -965,6 +974,9 @@ where
let tor_config = match tor_config {
Some(mut c) => {
if let Some(b) = args.bridge {
c.bridge.bridge_line = Some(b);
}
c.skip_send_attempt = Some(args.skip_tor);
Some(c)
}