From 37d38d6fa409701b01c11dfe8a7009e86bb474ea Mon Sep 17 00:00:00 2001 From: jorgeantonio21 Date: Wed, 17 Aug 2022 12:57:22 +0100 Subject: [PATCH] fix: remove use of hardcoded value (see issue #4451) (#4485) Description --- Remove the use of hard-coded value [here](https://github.com/tari-project/tari/blob/development/comms/dht/src/network_discovery/on_connect.rs#L94). Motivation and Context --- Fixes #4451 How Has This Been Tested? --- Manually. --- comms/dht/src/network_discovery/on_connect.rs | 5 ++--- integration_tests/features/WalletCli.feature | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/comms/dht/src/network_discovery/on_connect.rs b/comms/dht/src/network_discovery/on_connect.rs index 121ad1635e..8faa0f5fa2 100644 --- a/comms/dht/src/network_discovery/on_connect.rs +++ b/comms/dht/src/network_discovery/on_connect.rs @@ -20,7 +20,7 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::{convert::TryInto, time::Duration}; +use std::convert::TryInto; use futures::StreamExt; use log::*; @@ -41,7 +41,6 @@ use crate::{ }; const LOG_TARGET: &str = "comms::dht::network_discovery:onconnect"; - const NUM_FETCH_PEERS: u32 = 1000; #[derive(Debug)] @@ -91,7 +90,7 @@ impl OnConnect { .connectivity .ban_peer_until( conn.peer_node_id().clone(), - Duration::from_secs(60 * 60), + self.config().ban_duration, err.to_string(), ) .await diff --git a/integration_tests/features/WalletCli.feature b/integration_tests/features/WalletCli.feature index 000f9b655c..b0784d007a 100644 --- a/integration_tests/features/WalletCli.feature +++ b/integration_tests/features/WalletCli.feature @@ -139,4 +139,3 @@ Feature: Wallet CLI Given I have a base node BASE And I have wallet WALLET connected to base node BASE Then I run whois BASE on wallet WALLET via command line -