mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +02:00
Deprecate HTTP(S) (#532)
* Deprecate HTTP(S) * Remove http support altogether
This commit is contained in:
+5
-21
@@ -2324,7 +2324,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// attempt to send slate synchronously, starting with TOR and downgrading to HTTP
|
||||
/// attempt to send slate synchronously with TOR
|
||||
pub fn try_slatepack_sync_workflow(
|
||||
slate: &Slate,
|
||||
dest: &str,
|
||||
@@ -2355,7 +2355,7 @@ pub fn try_slatepack_sync_workflow(
|
||||
}
|
||||
};
|
||||
|
||||
// First, try TOR
|
||||
// Try parsing Slatepack address
|
||||
match SlatepackAddress::try_from(dest) {
|
||||
Ok(address) => {
|
||||
let tor_addr = OnionV3Address::try_from(&address).unwrap();
|
||||
@@ -2392,34 +2392,18 @@ pub fn try_slatepack_sync_workflow(
|
||||
Ok(_) => return Ok(Some(ret_slate)),
|
||||
Err(e) => {
|
||||
debug!("Unable to send via TOR: {}", e);
|
||||
warn!("Unable to send transaction via TOR. Attempting alternate methods.");
|
||||
warn!("Unable to send transaction via TOR");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
debug!("Send (TOR): Destination is not SlatepackAddress {:?}", e);
|
||||
warn!("Destination is not a valid Slatepack address. Will output Slatepack.")
|
||||
}
|
||||
}
|
||||
|
||||
// Try Fallback to HTTP for deprecation period
|
||||
match HttpSlateSender::new(&dest) {
|
||||
Ok(sender) => {
|
||||
println!("Attempting to send transaction via HTTP (deprecated)");
|
||||
match send_sync(sender, "HTTP") {
|
||||
Ok(_) => return Ok(Some(ret_slate)),
|
||||
Err(e) => {
|
||||
debug!("Unable to send via HTTP: {}", e);
|
||||
warn!("Unable to send transaction via HTTP. Will output Slatepack.");
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
debug!("Send (HTTP): Cannot create HTTP Slate sender {:?}", e);
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
||||
Reference in New Issue
Block a user