Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private long computeReward(long cycle, List<Pair<byte[], Long>> votes) {
}
long userVote = vote.getValue();
double voteRate = (double) userVote / totalVote;
reward += (long) (voteRate * totalReward);
reward += voteRate * totalReward;
}
return reward;
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/src/main/java/org/tron/common/crypto/Rsv.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static Rsv fromSignature(byte[] sign) {
byte[] s = Arrays.copyOfRange(sign, 32, 64);
byte v = sign[64];
if (v < 27) {
v += (byte) 27; //revId -> v
v += 27; //revId -> v
}
return new Rsv(r, s, v);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static short decodeShort(byte[] data, int index) {
byte pow = (byte) (length - 1);
for (int i = 1; i <= length; ++i) {
// << (8 * pow) == bit shift to 0 (*1), 8 (*256) , 16 (*65..)
value += (short) ((data[index + i] & 0xFF) << (8 * pow));
value += (data[index + i] & 0xFF) << (8 * pow);
pow--;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public DiversifierT defaultDiversifier() throws BadItemException, ZksnarkExcepti
throw new BadItemException(
"librustzcash_check_diversifier does not return valid diversifier");
}
blob[33] += (byte) 1;
blob[33] += 1;
} finally {
JLibsodium.freeState(state);
}
Expand Down