-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockHeader.java
More file actions
120 lines (101 loc) · 2.53 KB
/
Copy pathBlockHeader.java
File metadata and controls
120 lines (101 loc) · 2.53 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package com.mindata.blockchain.block;
import java.util.List;
/**
* 区块头
* @author wuweifeng wrote on 2018/2/27.
*/
public class BlockHeader {
/**
* 版本号
*/
private int version;
/**
* 上一区块的hash
*/
private String hashPreviousBlock;
/**
* merkle tree根节点hash
*/
private String hashMerkleRoot;
/**
* 生成该区块的公钥
*/
private String publicKey;
/**
* 区块的序号
*/
private int number;
/**
* 时间戳
*/
private long timeStamp;
/**
* 32位随机数
*/
private long nonce;
/**
* 该区块里每条交易信息的hash集合,按顺序来的,通过该hash集合能算出根节点hash
*/
private List<String> hashList;
@Override
public String toString() {
return "BlockHeader{" +
"version=" + version +
", hashPreviousBlock='" + hashPreviousBlock + '\'' +
", hashMerkleRoot='" + hashMerkleRoot + '\'' +
", publicKey='" + publicKey + '\'' +
", number=" + number +
", timeStamp=" + timeStamp +
", nonce=" + nonce +
", hashList=" + hashList +
'}';
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getHashPreviousBlock() {
return hashPreviousBlock;
}
public void setHashPreviousBlock(String hashPreviousBlock) {
this.hashPreviousBlock = hashPreviousBlock;
}
public String getHashMerkleRoot() {
return hashMerkleRoot;
}
public void setHashMerkleRoot(String hashMerkleRoot) {
this.hashMerkleRoot = hashMerkleRoot;
}
public String getPublicKey() {
return publicKey;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public long getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(long timeStamp) {
this.timeStamp = timeStamp;
}
public long getNonce() {
return nonce;
}
public void setNonce(long nonce) {
this.nonce = nonce;
}
public List<String> getHashList() {
return hashList;
}
public void setHashList(List<String> hashList) {
this.hashList = hashList;
}
}