Complete module API expansion: clearAll and batch helpers on every remaining module.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-21 03:48:27 -04:00
co-authored by Cursor
parent ff129d56b0
commit d1e8608280
22 changed files with 152 additions and 6 deletions
@@ -413,6 +413,17 @@ class HyperP2PCausalConsensus extends EventEmitter {
return n
}
clearAll () {
const decided = this.clearDecided()
const proposals = this.proposals.size
this.proposals.clear()
this.forksDetected.clear()
this.vectorClock.clear()
for (const timer of this._proposalTimers.values()) clearTimeout(timer)
this._proposalTimers.clear()
return { proposals, decided }
}
getMetrics () {
return { ...this._metrics, peers: this.peers.size, pendingProposals: this.proposals.size - this.decidedOrders.size }
}