From 5dc0c74615ad962798fadc0946c1788222bde6ba Mon Sep 17 00:00:00 2001 From: 8lecramm Date: Fri, 20 May 2022 00:43:35 +0200 Subject: [PATCH] use Flag field as nonce --- derohe-proxy.go | 9 ++------- proxy/feature.go | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/derohe-proxy.go b/derohe-proxy.go index bdf324f..5ad081f 100644 --- a/derohe-proxy.go +++ b/derohe-proxy.go @@ -15,18 +15,15 @@ func main() { Arguments, err = docopt.Parse(command_line, nil, true, "pre-alpha", false) if err != nil { - fmt.Printf("Error while parsing options err: %s\n", err) return } if Arguments["--listen-address"] != nil { addr, err := net.ResolveTCPAddr("tcp", Arguments["--listen-address"].(string)) if err != nil { - fmt.Printf("--listen-address: address is invalid\n") return } else { if addr.Port == 0 { - fmt.Printf("--listen-address: no port specified\n") return } else { listen_addr = addr.String() @@ -35,10 +32,8 @@ func main() { } if Arguments["--daemon-address"] == nil { - fmt.Printf("--daemon-address: option is required\n") return } else { - fmt.Printf("--daemon-address: is set to %v\n", Arguments["--daemon-address"].(string)) daemon_address = Arguments["--daemon-address"].(string) } @@ -51,7 +46,7 @@ func main() { go proxy.Start_client(daemon_address, proxy.Address) for { - time.Sleep(time.Minute) - fmt.Printf("%4d miners connected\t\tBlocks:%4d\tMiniblocks:%4d\tRejected:%4d\n", proxy.CountMiners(), proxy.Blocks, proxy.Minis, proxy.Rejected) + time.Sleep(time.Minute * 5) + fmt.Printf("%v %4d miners connected\t\tBlocks:%4d\tMiniblocks:%4d\tRejected:%4d\n", time.Now().Format(time.Stamp), proxy.CountMiners(), proxy.Blocks, proxy.Minis, proxy.Rejected) } } diff --git a/proxy/feature.go b/proxy/feature.go index a0b03a5..8613da5 100644 --- a/proxy/feature.go +++ b/proxy/feature.go @@ -33,6 +33,7 @@ func edit_blob(input []byte) (output []byte) { for i := range mbl.Nonce { mbl.Nonce[i] = rand.Uint32() } + mbl.Flags = rand.Uint32() params.Blockhashing_blob = fmt.Sprintf("%x", mbl.Serialize()) encoder := json.NewEncoder(&out)