Skip to content

Commit ef7d665

Browse files
committed
bugfix
1 parent efbf35c commit ef7d665

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

mytoncore.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3758,11 +3758,11 @@ def Elections(ton):
37583758
ton.ElectionEntry()
37593759
#end define
37603760

3761-
def Statistics(scanner):
3761+
def Statistics():
37623762
ReadNetworkData()
37633763
SaveNetworkStatistics()
3764-
ReadTransData(scanner)
3765-
SaveTransStatistics()
3764+
#ReadTransData(scanner)
3765+
#SaveTransStatistics()
37663766
ReadDiskData()
37673767
SaveDiskStatistics()
37683768
#end define
@@ -3862,7 +3862,6 @@ def ReadNetworkData():
38623862
buff = psutil.net_io_counters(pernic=True)
38633863
buff = buff[interfaceName]
38643864
data = dict()
3865-
data = dict()
38663865
data["timestamp"] = timestamp
38673866
data["bytesRecv"] = buff.bytes_recv
38683867
data["bytesSent"] = buff.bytes_sent
@@ -4087,7 +4086,7 @@ def Telemetry(ton):
40874086
data["stake"] = local.db.get("stake")
40884087

40894088
# Get validator config
4090-
vconfig = self.GetValidatorConfig()
4089+
vconfig = ton.GetValidatorConfig()
40914090
data["fullnode_adnl"] = vconfig.fullnode
40924091

40934092
# Send data to toncenter server
@@ -4192,12 +4191,10 @@ def ScanLiteServers(ton):
41924191
def General():
41934192
local.add_log("start General function", "debug")
41944193
ton = MyTonCore()
4195-
scanner = Dict()
4196-
#scanner.Run()
41974194

41984195
# Запустить потоки
41994196
local.start_cycle(Elections, sec=600, args=(ton, ))
4200-
local.start_cycle(Statistics, sec=10, args=(scanner,))
4197+
local.start_cycle(Statistics, sec=10)
42014198
local.start_cycle(Offers, sec=600, args=(ton, ))
42024199
local.start_cycle(Complaints, sec=600, args=(ton, ))
42034200
local.start_cycle(Slashing, sec=600, args=(ton, ))

mytonctrl.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def check_vport():
127127
color_print(local.translate("vport_error"))
128128
#end define
129129

130-
def check_git(input_args, default_repo):
130+
def check_git(input_args, default_repo, text):
131131
src_dir = "/usr/src"
132132
git_path = f"{src_dir}/{default_repo}"
133133
default_author = "ton-blockchain"
@@ -147,9 +147,9 @@ def check_git(input_args, default_repo):
147147
if ((need_author is None and local_author != default_author) or
148148
(need_repo is None and local_repo != default_repo)):
149149
remote_url = f"https://github.com/{local_author}/{local_repo}/tree/{need_branch if need_branch else local_branch}"
150-
raise Exception(f"update error: You are on {remote_url} remote url, to update to the tip use `update {remote_url}` command")
150+
raise Exception(f"{text} error: You are on {remote_url} remote url, to {text} to the tip use `{text} {remote_url}` command")
151151
elif need_branch is None and local_branch != default_branch:
152-
raise Exception(f"update error: You are on {local_branch} branch, to update to the tip of {local_branch} branch use `update {local_branch}` command")
152+
raise Exception(f"{text} error: You are on {local_branch} branch, to {text} to the tip of {local_branch} branch use `{text} {local_branch}` command")
153153
#end if
154154

155155
if need_author is None:
@@ -185,7 +185,7 @@ def GetAuthorRepoBranchFromArgs(args):
185185

186186
def Update(args):
187187
repo = "mytonctrl"
188-
author, repo, branch = check_git(args, repo)
188+
author, repo, branch = check_git(args, repo, "update")
189189

190190
# Run script
191191
runArgs = ["bash", "/usr/src/mytonctrl/scripts/update.sh", "-a", author, "-r", repo, "-b", branch]
@@ -200,7 +200,7 @@ def Update(args):
200200

201201
def Upgrade(args):
202202
repo = "ton"
203-
author, repo, branch = check_git(args, repo)
203+
author, repo, branch = check_git(args, repo, "upgrade")
204204

205205
# Run script
206206
runArgs = ["bash", "/usr/src/mytonctrl/scripts/upgrade.sh", "-a", author, "-r", repo, "-b", branch]

0 commit comments

Comments
 (0)