From ce74f16b97576cc0847d63ce927335cbff70d4ac Mon Sep 17 00:00:00 2001 From: xiaoch05 Date: Tue, 12 Mar 2024 17:44:55 +0800 Subject: [PATCH] filter offline relayer --- apollo/src/aggregation/aggregation.resolver.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apollo/src/aggregation/aggregation.resolver.ts b/apollo/src/aggregation/aggregation.resolver.ts index 83feec10..9d174231 100644 --- a/apollo/src/aggregation/aggregation.resolver.ts +++ b/apollo/src/aggregation/aggregation.resolver.ts @@ -321,8 +321,14 @@ export class AggregationResolver { where, }); let supportChains = new Map(); + const now = Math.floor(Date.now() / 1000); for (const record of records.records) { + if (record.heartbeatTimestamp + this.heartbeatTimeout < now) { + continue; + } + let toChains = supportChains.get(record.fromChain); + if (!toChains) { supportChains.set(record.fromChain, [ record.toChain ]); } else {