Commit de28a338 authored by Pascal Engélibert's avatar Pascal Engélibert fix -e arg, print nb ids

parent f9391ee7
......@@ -38,6 +38,7 @@ Options:
iindex = plyvel.DB(dbpath + "/level_iindex")
cindex = plyvel.DB(dbpath + "/level_cindex")
i = 0
for pub, row in iindex:
idty = json.loads(row.decode())[0]
certs = json.loads(cindex.get(pub).decode())
......@@ -46,9 +47,11 @@ Options:
for cert in certs["issued"]:
if cert["expired_on"] == 0:
result["certs"].append([idty["pub"], cert["receiver"], cert["expires_on"], cert["expired_on"], cert["writtenOn"]])
i += 1
if "-e" in sys.argv:
exportJSON(getargv(sys.argv, "-e", "duniterdb.json"), result)
print("Identities: {}".format(i))
exportJSON(getargv(sys.argv, "-e", "duniterdb.json"), result)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment