Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions yarn-project/p2p/src/mem_pools/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ export class PoolInstrumentation<PoolObject extends Gossipable> {
public transactionsRemoved(hashes: Iterable<bigint> | Iterable<string>) {
const timestamp = Date.now();
for (const hash of hashes) {
const addedAt = this.txAddedTimestamp.get(BigInt(hash));
if (addedAt) {
this.txAddedTimestamp.delete(BigInt(hash));
this.minedDelay.record(addedAt - timestamp);
const key = BigInt(hash);
const addedAt = this.txAddedTimestamp.get(key);
if (addedAt !== undefined) {
this.txAddedTimestamp.delete(key);
if (addedAt < timestamp) {
this.minedDelay.record(timestamp - addedAt);
}
}
}
}
Expand Down
Loading