Update public source

This commit is contained in:
2026-10-13 08:00:22 +03:00
parent a0ad384f1e
commit 4876d2de9c
3 changed files with 29 additions and 9 deletions
+26 -8
View File
@@ -13,9 +13,32 @@ class HandshakesRepository:
method_id: str,
method_version: int,
limit: int | None,
handshake_ids: list[int] | tuple[int, ...] | None = None,
) -> list[sqlite3.Row]:
if handshake_ids is not None and not handshake_ids:
return []
id_filter = ""
parameters: list[Any] = [
method_id,
method_version,
method_id,
method_version,
]
if handshake_ids is not None:
placeholders = ", ".join(
"?" for _ in handshake_ids
)
id_filter = f"AND h.id IN ({placeholders})"
parameters.extend(handshake_ids)
parameters.append(
limit if limit is not None else -1
)
return self._conn.execute(
"""
f"""
SELECT
h.id AS handshake_id,
h.hash22000,
@@ -45,16 +68,11 @@ class HandshakesRepository:
AND r.method_version = ?
AND r.status = 'ACTIVE'
)
{id_filter}
ORDER BY h.id
LIMIT ?
""",
(
method_id,
method_version,
method_id,
method_version,
limit if limit is not None else -1,
),
parameters,
).fetchall()
def get_method_statistics(