From dd933fc78b4b17ffc1c9b75a4960826806f5cfdd Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Thu, 1 Jul 2021 17:55:35 +1000 Subject: [PATCH] Add some TODOs --- swap/src/asb/config.rs | 2 ++ swap/src/asb/rendezvous.rs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/swap/src/asb/config.rs b/swap/src/asb/config.rs index 98e8aa2f..ef4ac507 100644 --- a/swap/src/asb/config.rs +++ b/swap/src/asb/config.rs @@ -304,6 +304,8 @@ pub fn query_user_for_initial_config(testnet: bool) -> Result { } let ask_spread = Decimal::from_f64(ask_spread).context("Unable to parse spread")?; + // TODO: This is not complete given that the rendezvous section is optional - we + // could go for yes/no here first? let rendezvous_peer_id_str = Input::with_theme(&ColorfulTheme::default()) .with_prompt("Enter the peer id of the rendezvous node you wish to register with") .default(DEFAULT_RENDEZVOUS_PEER_ID.to_string()) diff --git a/swap/src/asb/rendezvous.rs b/swap/src/asb/rendezvous.rs index 301c30cc..015a1bd2 100644 --- a/swap/src/asb/rendezvous.rs +++ b/swap/src/asb/rendezvous.rs @@ -54,10 +54,18 @@ impl Behaviour { .expect("our namespace to be a correct string"), self.rendezvous_point_peer_id, None, - )?; + ); } } } else { + // TODO: The refresh has to be tied to a refersh time that is tied to us having + // gotten a Ttl! We should not be able to refresh like this, + // because it may result in constant retry (with new connections) if there is an + // error on the rendezvous side and the connection is closed. + // In such an error scenario the initial dial to the rendezvous node should + // just fail and then we get an error on the ASB and don't try again. (pointless + // to try again anyway if the rendezvous server is broken / not available) + let p2p_suffix = Protocol::P2p(self.rendezvous_point_peer_id.into()); let address_with_p2p = if !self .rendezvous_point_addr