feat(modules): manual deepen gossip, bloom, trust, storage, economy
Gossip mesh drop rate, bloom batch filter, blind relay best pick, key rotation helpers, OR-map values, writer lease releaseAll, view sync catchUp, channel prune, credit closeAccount, argv bridge. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -76,6 +76,16 @@ class HyperP2PCreditLedger extends EventEmitter {
|
||||
return a ? { id: a.id, balance: a.balance, updatedAt: a.updatedAt } : null
|
||||
}
|
||||
|
||||
closeAccount (accountId) {
|
||||
assertNonEmpty(accountId, 'accountId')
|
||||
const a = this._accounts.get(accountId)
|
||||
if (!a) return false
|
||||
if (a.balance !== 0) throw new Error('account balance must be zero')
|
||||
this._accounts.delete(accountId)
|
||||
this.emit('closed-account', { accountId })
|
||||
return true
|
||||
}
|
||||
|
||||
_apply (accountId, delta, kind, reason) {
|
||||
assertNonEmpty(accountId, 'accountId')
|
||||
const acct = this._accounts.get(accountId)
|
||||
|
||||
Reference in New Issue
Block a user