mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-22 20:26:50 +00:00
Fix incorrect PoW buffer usage length in verify & adjust difficulties
CHAT: 8 or 14 MESSAGE: 14 PUBLICIZE: 15 Handshake: 8 Added test to cover verify bug
This commit is contained in:
@@ -66,7 +66,7 @@ public class MemoryPoW {
|
||||
byteBuffer = null;
|
||||
|
||||
int longBufferLength = workBufferLength / 8;
|
||||
long[] workBuffer = new long[longBufferLength / 8];
|
||||
long[] workBuffer = new long[longBufferLength];
|
||||
long[] state = new long[4];
|
||||
|
||||
long seed = 8682522807148012L;
|
||||
|
@@ -211,7 +211,7 @@ public enum Handshake {
|
||||
private static final Pattern VERSION_PATTERN = Pattern.compile(Controller.VERSION_PREFIX + "(\\d{1,3})\\.(\\d{1,5})\\.(\\d{1,5})");
|
||||
|
||||
private static final int POW_BUFFER_SIZE = 8 * 1024 * 1024; // bytes
|
||||
private static final int POW_DIFFICULTY = 12; // leading zero bits
|
||||
private static final int POW_DIFFICULTY = 8; // leading zero bits
|
||||
|
||||
private static final byte[] ZERO_CHALLENGE = new byte[ChallengeMessage.CHALLENGE_LENGTH];
|
||||
|
||||
|
@@ -26,8 +26,8 @@ public class ChatTransaction extends Transaction {
|
||||
// Other useful constants
|
||||
public static final int MAX_DATA_SIZE = 256;
|
||||
public static final int POW_BUFFER_SIZE = 8 * 1024 * 1024; // bytes
|
||||
public static final int POW_DIFFICULTY_WITH_QORT = 12; // leading zero bits
|
||||
public static final int POW_DIFFICULTY_NO_QORT = 16; // leading zero bits
|
||||
public static final int POW_DIFFICULTY_WITH_QORT = 8; // leading zero bits
|
||||
public static final int POW_DIFFICULTY_NO_QORT = 14; // leading zero bits
|
||||
|
||||
// Constructors
|
||||
|
||||
|
@@ -26,7 +26,7 @@ public class PublicizeTransaction extends Transaction {
|
||||
/** If time difference between transaction and now is greater than this then we don't verify proof-of-work. */
|
||||
public static final long HISTORIC_THRESHOLD = 2 * 7 * 24 * 60 * 60 * 1000L;
|
||||
public static final int POW_BUFFER_SIZE = 8 * 1024 * 1024; // bytes
|
||||
public static final int POW_DIFFICULTY = 18; // leading zero bits
|
||||
public static final int POW_DIFFICULTY = 15; // leading zero bits
|
||||
|
||||
// Constructors
|
||||
|
||||
|
Reference in New Issue
Block a user