Add pending_anchors count to anchor stats

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-09 03:43:06 +00:00
parent 29b838fdda
commit 7faa249162

4
db.py
View File

@@ -689,6 +689,9 @@ async def get_anchor_stats() -> dict:
confirmed_anchors = await conn.fetchval(
"SELECT COUNT(*) FROM anchors WHERE confirmed_at IS NOT NULL"
)
pending_anchors = await conn.fetchval(
"SELECT COUNT(*) FROM anchors WHERE confirmed_at IS NULL"
)
anchored_activities = await conn.fetchval(
"SELECT COUNT(*) FROM activities WHERE anchor_root IS NOT NULL"
)
@@ -698,6 +701,7 @@ async def get_anchor_stats() -> dict:
return {
"total_anchors": total_anchors,
"confirmed_anchors": confirmed_anchors,
"pending_anchors": pending_anchors,
"anchored_activities": anchored_activities,
"unanchored_activities": unanchored_activities
}