mirror of
https://github.com/pezkuwichain/pezkuwi-subquery.git
synced 2026-07-22 07:35:41 +00:00
24fe8b6b6f
hasDataChanged() only compared fresh data against CachedStakingDetails - which stays empty until a submission matures and gets finalized. For any account whose real stake was genuinely stable, every 5-minute scan still saw "changed from empty cache", resubmitted, and reset submitted_at to the current block. Confirmed live: Serok's and QaziM's real, correctly-computed stake (490,000 / 100,000 HEZ) never once reached CachedStakingDetails/ TrustScores despite multiple successful submissions - each new scan arrived before the previous one's 300-block dispute window elapsed and overwrote it with a fresh timer, a self-perpetuating loop. getPendingData() now reads PendingStakingDetails first; hasDataChanged() compares against that when present, only falling back to the cache once nothing is pending. Applied to both the AssetHub and legacy RelayChain-clear comparisons. Also reordered main()'s cycle to finalizeMaturedPending() before fullScan(), so anything that matured this cycle gets promoted before a new scan pass runs at all.