Complete module API expansion: clearAll and batch helpers on every remaining module.
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user