use Flag field as nonce

This commit is contained in:
8lecramm 2022-05-20 00:43:35 +02:00
parent 7bd8757458
commit 5dc0c74615
2 changed files with 3 additions and 7 deletions

View File

@ -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)
}
}

View File

@ -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)