Skip to content

Commit

Permalink
Merge pull request #422 from yungwine/stake-alert
Browse files Browse the repository at this point in the history
fix list_alerts
  • Loading branch information
igroman787 authored Feb 3, 2025
2 parents b8086d0 + 399b6b0 commit d97e401
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/alert_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def disable_alert(self, args):
color_print("disable_alert - {green}OK{endc}")

def print_alerts(self, args):
init_alerts()
table = [['Name', 'Enabled', 'Last sent']]
for alert_name in ALERTS:
alert = self.get_alert_from_db(alert_name)
Expand Down Expand Up @@ -337,7 +338,7 @@ def check_stake_returned(self):
if not self.ton.using_validator():
return
config = self.ton.GetConfig32()
if not (config['endWorkTime'] + FREEZE_PERIOD + 1800 <= time.time() < config['endWorkTime'] + FREEZE_PERIOD + 1860): # check between 25th and 26th minutes after stakes have been unfrozen
if not (config['endWorkTime'] + FREEZE_PERIOD + 1800 <= time.time() < config['endWorkTime'] + FREEZE_PERIOD + 1860): # check between 30th and 31st minutes after stakes have been unfrozen
return
res = self.get_myself_from_election(config)
if not res:
Expand All @@ -356,6 +357,9 @@ def check_voting(self):
validator_index = self.ton.GetValidatorIndex()
if validator_index == -1:
return
config = self.ton.GetConfig34()
if time.time() - config['startWorkTime'] < 600: # less than 10 minutes passed since round start
return
need_to_vote = []
offers = self.ton.GetOffers()
for offer in offers:
Expand Down

0 comments on commit d97e401

Please sign in to comment.