Expand 35 modules across encoding, consensus, experimental, messaging, pear, storage, and supercomputer APIs.
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -336,6 +336,18 @@ class HyperP2PPresence extends EventEmitter {
|
||||
return [...this.peers.keys()]
|
||||
}
|
||||
|
||||
clearAll () {
|
||||
const selfKey = b4a.toString(this.keyPair.publicKey, 'hex')
|
||||
let n = 0
|
||||
for (const id of this.peerIds()) {
|
||||
if (id !== selfKey) {
|
||||
this.peers.delete(id)
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
announceNow () {
|
||||
this._broadcastPresence()
|
||||
return this.getSelf()
|
||||
|
||||
Reference in New Issue
Block a user