Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
igroman787 committed Feb 19, 2021
1 parent ab25c8c commit 7cbabf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
25 changes: 13 additions & 12 deletions mytoncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,8 @@ def GetValidatorsLoad(self, start=None, end=None, timeDiff=2000, saveCompFiles=F
return data
#end if

local.AddLog("start GetValidatorsLoad function", "debug")
text = "start GetValidatorsLoad function ({}, {})".format(start, end)
local.AddLog(text, "debug")
if saveCompFiles is True:
filePrefix = self.tempDir + "checkload_{start}_{end}".format(start=start, end=end)
else:
Expand All @@ -1860,6 +1861,7 @@ def GetValidatorsLoad(self, start=None, end=None, timeDiff=2000, saveCompFiles=F
vid = vid.replace(':', '')
vid = int(vid)
pubkey = buff[3]
pubkey = pubkey.replace(',', '')
blocksCreated_buff = buff[6]
blocksCreated_buff = blocksCreated_buff.replace('(', '')
blocksCreated_buff = blocksCreated_buff.replace(')', '')
Expand Down Expand Up @@ -1893,16 +1895,15 @@ def GetValidatorsLoad(self, start=None, end=None, timeDiff=2000, saveCompFiles=F
item["online"] = online

# Get complaint file
try:
index = lines.index(line)
nextLine = lines[index+2]
if "COMPLAINT_SAVED" in nextLine:
buff = line.split('\t')
item["var1"] = buff[1]
item["var2"] = buff[2]
item["fileName"] = buff[3]
except: pass

index = lines.index(line)
if index+2 > len(lines):
continue
nextLine = lines[index+2]
if "COMPLAINT_SAVED" in nextLine:
buff = line.split('\t')
item["var1"] = buff[1]
item["var2"] = buff[2]
item["fileName"] = buff[3]
data[vid] = item
#end for

Expand Down Expand Up @@ -2750,7 +2751,7 @@ def General():
local.StartCycle(Statistics, sec=10, args=(ton, ))
local.StartCycle(Offers, sec=600, args=(ton, ))
local.StartCycle(Complaints, sec=600, args=(ton, ))
local.StartCycle(Slashing, sec=60, args=(ton, ))
local.StartCycle(Slashing, sec=600, args=(ton, ))
local.StartCycle(Domains, sec=600, args=(ton, ))
local.StartCycle(Telemetry, sec=60, args=(ton, ))
local.StartCycle(Mining, sec=1, args=(ton, ))
Expand Down
5 changes: 1 addition & 4 deletions mytonctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ def Test(args):
#end define

def Test2(args):
config34 = ton.GetConfig34()
start = config34.get("startWorkTime")
end = config34.get("endWorkTime")
ton.CheckValidators(start, end)
Slashing(ton)
#end define

def TestWork(ok_arr, pending_arr):
Expand Down

0 comments on commit 7cbabf7

Please sign in to comment.