Skip to content

Commit 835f5bb

Browse files
committed
proper calculate total weight for btc teleport offers
1 parent b64077b commit 835f5bb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/btc_teleport.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,13 @@ def get_offers(self):
111111
result = self.ton.liteClient.Run(cmd)
112112
raw_offers = self.ton.Result2List(result)
113113
raw_offers = raw_offers[0]
114-
config34 = self.ton.GetConfig34()
115-
total_weight = config34.get("totalWeight")
114+
validators = self.ton.GetValidatorsList(fast=True)
115+
total_weight = 0
116+
for v in validators:
117+
if v['is_masterchain'] is False:
118+
continue
119+
total_weight += v['weight']
120+
116121
offers = {}
117122
for offer in raw_offers:
118123
if len(offer) == 0:

0 commit comments

Comments
 (0)