Skip to content

Commit 8e59023

Browse files
committed
fix autovoting for teleport offer
1 parent 3e8fc7b commit 8e59023

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

modules/btc_teleport.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ def auto_vote_offers(self):
104104
self.local.add_log(f'Removing offer {offer_hash} from saved offers', 'debug')
105105
continue
106106
offer = current_offers[save_offer['hash']]
107-
self.vote_offer_btc_teleport([offer['hash']])
107+
if offer['created_at'] != save_offer['created_at'] and save_offer['ttl'] > config34['endWorkTime']: # offer is not expired but has been changed, so it has been accepted and launched again
108+
save_offers.pop(offer_hash)
109+
self.local.add_log(f'Removing offer {offer_hash} from saved offers', 'debug')
110+
continue
111+
self.vote_offer_btc_teleport([offer_hash])
108112

109113
def get_offers(self):
110114
self.local.add_log("start get_offers_btc_teleport function", "debug")

mytoncore/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def General(local):
676676
local.start_cycle(PrometheusModule(ton, local).push_metrics, sec=30, args=())
677677

678678
from modules.btc_teleport import BtcTeleportModule
679-
local.start_cycle(BtcTeleportModule(ton, local).auto_vote_offers, sec=600, args=())
679+
local.start_cycle(BtcTeleportModule(ton, local).auto_vote_offers, sec=180, args=())
680680

681681
if ton.in_initial_sync():
682682
local.start_cycle(check_initial_sync, sec=120, args=(local, ton))

0 commit comments

Comments
 (0)