refactor: simplify localHistory initialization by removing intermediate constant

This commit is contained in:
Danish Arora 2025-11-20 16:07:35 -05:00
parent 8428957508
commit 81e9070ea8
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E

View File

@ -117,9 +117,8 @@ export class MessageChannel extends TypedEventEmitter<MessageChannelEvents> {
this.outgoingBuffer = [];
this.possibleAcks = new Map();
this.incomingBuffer = [];
const resolvedLocalHistory =
this.localHistory =
localHistory ?? new PersistentHistory({ channelId: this.channelId });
this.localHistory = resolvedLocalHistory;
this.causalHistorySize =
options.causalHistorySize ?? DEFAULT_CAUSAL_HISTORY_SIZE;
// TODO: this should be determined based on the bloom filter parameters and number of hashes