fixed 100% CPU load issue

This commit is contained in:
8lecramm 2022-05-15 02:23:26 +02:00
parent 47fda6a514
commit 7bd8757458

View File

@ -50,14 +50,8 @@ func main() {
} }
go proxy.Start_client(daemon_address, proxy.Address) go proxy.Start_client(daemon_address, proxy.Address)
var current_time time.Time
last_time := time.Now()
//fmt.Printf("%4d miners connected\t\tBlocks:%4d\tMiniblocks:%4d\tRejected:%4d\n", proxy.CountMiners(), proxy.Blocks, proxy.Minis, proxy.Rejected)
for { for {
current_time = time.Now() time.Sleep(time.Minute)
if current_time.Sub(last_time) >= time.Minute {
fmt.Printf("%4d miners connected\t\tBlocks:%4d\tMiniblocks:%4d\tRejected:%4d\n", proxy.CountMiners(), proxy.Blocks, proxy.Minis, proxy.Rejected) fmt.Printf("%4d miners connected\t\tBlocks:%4d\tMiniblocks:%4d\tRejected:%4d\n", proxy.CountMiners(), proxy.Blocks, proxy.Minis, proxy.Rejected)
last_time = time.Now()
}
} }
} }