mirror of
https://github.com/pezkuwichain/pezkuwi-subquery.git
synced 2026-04-21 22:27:56 +00:00
718fea7cad
processAccount() was comparing direct staking against cache BEFORE checking pool data. This caused a flip-flop: when cache=121K and direct=100K, the bot submitted 100K (missing pool). Next scan it detected the difference and submitted 121K. Every 5 minutes, forever. Worse, when direct staking went to 0, the bot submitted 0 which caused the pallet to delete StakingStartBlock — permanently removing the user from tracking and zeroing their trust score. Fix: collect ALL staking data (direct + pool) first, combine into a single total, then compare against cache. Also adds queryFailed flag to prevent downgrading stake when pool RPC query fails.