Mercurial > hg > Database > Christie
comparison src/main/java/christie/blockchain/BlockHeader.java @ 156:cd2fab84cd8b
update static HashUtil
author | akahori |
---|---|
date | Thu, 10 Jan 2019 18:04:38 +0900 |
parents | 0ef25958ac04 |
children |
comparison
equal
deleted
inserted
replaced
155:4048eb57ec07 | 156:cd2fab84cd8b |
---|---|
19 | 19 |
20 private long timestamp; | 20 private long timestamp; |
21 | 21 |
22 private long nonce; | 22 private long nonce; |
23 | 23 |
24 HashUtil hashUtil = new HashUtil(); | |
25 | 24 |
26 public BlockHeader(byte[] parentHash, long difficulty, long number, long timestamp) { | 25 public BlockHeader(byte[] parentHash, long difficulty, long number, long timestamp) { |
27 this.parentHash = parentHash; | 26 this.parentHash = parentHash; |
28 this.difficulty = difficulty; | 27 this.difficulty = difficulty; |
29 this.number = number; | 28 this.number = number; |
61 return parentHash; | 60 return parentHash; |
62 } | 61 } |
63 | 62 |
64 public byte[] getPresentHash() { | 63 public byte[] getPresentHash() { |
65 | 64 |
66 return hashUtil.sha256(getParamByteArray(true)); | 65 return HashUtil.sha256(getParamByteArray(true)); |
67 } | 66 } |
68 | 67 |
69 public byte[] getByteArrayWithoutNonce(){ | 68 public byte[] getByteArrayWithoutNonce(){ |
70 | 69 |
71 return getParamByteArray(false); | 70 return getParamByteArray(false); |