-
Notifications
You must be signed in to change notification settings - Fork 0
/
chash.go
66 lines (50 loc) · 1.01 KB
/
chash.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"fmt"
"strings"
"strconv"
"encoding/gob"
"../config"
"../core"
)
var echo=fmt.Println
var Configure config.Configuration
var addr="CLQUKEdCeWmPzAmyJdHzo9cTBrq2JCBbPC"
func init() {
Configure=config.LoadConfiguration("../config/cubechain.conf")
core.Configure=Configure
core.CubenoSet()
echo (core.CubeSetNum)
if core.GenFile=="" {
path:="../config/genfile"
core.GenFile=core.FileReadString(path)
line:=strings.Split(core.GenFile,"\r\n")
for _,v:=range line {
result:=strings.Split(v, "|")
genno,ok:=strconv.Atoi(result[0])
if ok==nil {
core.GenBlock[genno-1]+=v+"\r\n"
}
}
}
gob.Register(&core.TxData{})
gob.Register(&core.TxBST{})
gob.Register(map[string]string{})
}
func main() {
cubecheck();
}
func cubecheck() {
var c core.Cube
c.Cubeno=6950
c.Read()
hstr:=c.HashString()
result:=core.CallHash(hstr,4)
chstr:=result+strconv.Itoa(c.Nonce)
cresult:=core.CallHash(chstr,2)
echo(hstr)
echo(result)
echo(cresult)
echo(c.CHash)
echo(c.Nonce)
}