Skip to content

Commit a6f9d1d

Browse files
committed
fix copy error
1 parent 0144bc3 commit a6f9d1d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/main/java/org/tron/common/utils/Sha256Hash.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ public class Sha256Hash implements Serializable, Comparable<Sha256Hash> {
4747

4848
private byte[] generateBlockId(long blockNum, Sha256Hash blockHash) {
4949
byte[] numBytes = Longs.toByteArray(blockNum);
50-
byte[] hash = blockHash.getBytes();
50+
51+
byte[] hash = new byte[blockHash.getBytes().length];
52+
5153
System.arraycopy(numBytes, 0, hash, 0, 8);
54+
System.arraycopy(blockHash.getBytes(), 8, hash, 8, blockHash.getBytes().length - 8);
5255
return hash;
5356
}
5457

0 commit comments

Comments
 (0)