From aca30a721b6ba28567a5f85bc3c8584921858fbc Mon Sep 17 00:00:00 2001 From: Egbert Bouman Date: Fri, 29 Jan 2021 11:44:45 +0100 Subject: [PATCH] Check for duplicate BalanceRequestCaches --- .../modules/tunnel/community/triblertunnel_community.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tribler-core/tribler_core/modules/tunnel/community/triblertunnel_community.py b/src/tribler-core/tribler_core/modules/tunnel/community/triblertunnel_community.py index 205911f8ca9..2cabee92daa 100644 --- a/src/tribler-core/tribler_core/modules/tunnel/community/triblertunnel_community.py +++ b/src/tribler-core/tribler_core/modules/tunnel/community/triblertunnel_community.py @@ -205,8 +205,12 @@ def should_join_circuit(self, create_payload, previous_node_address): self.logger.warning("too many relays (%d)", (len(self.relay_from_to) + len(self.exit_sockets))) return succeed(False) - # Check whether we have a random open slot, if so, allocate this to this request. circuit_id = create_payload.circuit_id + if self.request_cache.has('balance-request', circuit_id): + self.logger.warning("balance request already in progress for circuit %d", circuit_id) + return succeed(False) + + # Check whether we have a random open slot, if so, allocate this to this request. for index, slot in enumerate(self.random_slots): if not slot: self.random_slots[index] = circuit_id