Skip to content

Commit

Permalink
Merge pull request #319 from Junze888/develop
Browse files Browse the repository at this point in the history
fixed node create TX block diff is 1.
  • Loading branch information
LucasMLK authored Jun 23, 2024
2 parents fcc24fc + 3ffeeb9 commit 550f523
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/io/xdag/core/BlockchainImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,11 @@ public BigInteger calculateCurrentBlockDiff(Block block) {
if (block.getInfo().getDifficulty() != null) {
return block.getInfo().getDifficulty();
}
//TX block would not set diff, fix a diff = 1;
if (!block.getInputs().isEmpty()) {
return BigInteger.ONE;
}

BigInteger blockDiff;
// 初始区块自身难度设置
if (randomx != null && randomx.isRandomxFork(XdagTime.getEpoch(block.getTimestamp()))
Expand Down

0 comments on commit 550f523

Please sign in to comment.