Skip to content

Commit fbb4a8d

Browse files
Fix logic for matchmaking block lists (#1182)
I noticed recently that despite using an online block list, my engine (https://lichess.org/@/jpg-bot) is still making challenges to bots which have been blocked. I mentioned this in an engine dev Discord server and @jbienvenue picked it up and tracked down the issue. If an engine is in the online block list, in_block_list currently returns false. Co-authored-by: jbienvenue <159717724+jbienvenue@users.noreply.github.com>
1 parent efbf6d3 commit fbb4a8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matchmaking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def add_to_block_list(self, username: str) -> None:
270270

271271
def in_block_list(self, username: str) -> bool:
272272
"""Check if an opponent is in the block list to prevent future challenges."""
273-
return not (self.should_accept_challenge(username, "") or username in self.online_block_list)
273+
return (not self.should_accept_challenge(username, "")) or username in self.online_block_list
274274

275275
def add_challenge_filter(self, username: str, game_aspect: str, timeout: datetime.timedelta | None = None) -> None:
276276
"""

0 commit comments

Comments
 (0)