Skip to content

Commit 6e0c68e

Browse files
committed
Avoid problems with PoC+ and the max deadline.
1 parent bf5f285 commit 6e0c68e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/burst/pool/pool/Pool.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ BigInteger checkNewSubmission(Submission submission, String userAgent) throws Su
362362
MiningInfo localMiningInfo = miningInfo.get();
363363
BigInteger deadline = burstCrypto.calculateDeadline(submission.getMiner(), Long.parseUnsignedLong(submission.getNonce().toString()), localMiningInfo.getGenerationSignature(), burstCrypto.calculateScoop(localMiningInfo.getGenerationSignature(), localMiningInfo.getHeight()), localMiningInfo.getBaseTarget(), 2);
364364

365-
if (deadline.compareTo(BigInteger.valueOf(propertyService.getLong(Props.maxDeadline))) >= 0) {
365+
// With PoC+ we have up to a factor of 8, since miner software is unaware of that we need to accept it up to 8 times larger
366+
long factor = localMiningInfo.getHeight() >= propertyService.getInt(Props.pocPlusBlock) ? 8 : 1;
367+
if (deadline.compareTo(BigInteger.valueOf(propertyService.getLong(Props.maxDeadline) * factor)) >= 0) {
366368
throw new SubmissionException("Deadline exceeds maximum allowed deadline");
367369
}
368370

0 commit comments

Comments
 (0)