-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust analysis scripts to new database schema
- Loading branch information
1 parent
517d0bd
commit 8fd062d
Showing
8 changed files
with
70 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# get_multi_addresses gets the multi addresses of the given peers. | ||
# It takes an sql connection, the peer **database** ids as arguments, and | ||
# returns the agent version info of these peer ids. | ||
def get_multi_addresses(conn, peer_ids): | ||
cur = conn.cursor() | ||
res = dict() | ||
cur.execute( | ||
""" | ||
SELECT p.id, ma.maddr | ||
FROM peers p | ||
INNER JOIN peers_x_multi_addresses pxma on p.id = pxma.peer_id | ||
INNER JOIN multi_addresses ma on pxma.multi_address_id = ma.id | ||
WHERE p.id IN (%s) | ||
""" % ','.join(['%s'] * len(peer_ids)), | ||
tuple(peer_ids) | ||
) | ||
for id, maddr in cur.fetchall(): | ||
res[id] = maddr | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters