Browse Source

minAccountLevelForBlockSubmissions moved to blockchain.json

block-minter-updates
CalDescent 3 years ago
parent
commit
a35e309a2f
  1. 5
      src/main/java/org/qortal/block/BlockChain.java
  2. 11
      src/main/java/org/qortal/controller/BlockMinter.java
  3. 1
      src/main/resources/blockchain.json

5
src/main/java/org/qortal/block/BlockChain.java

@ -142,6 +142,7 @@ public class BlockChain {
private List<BlockTimingByHeight> blockTimingsByHeight;
private int minAccountLevelToMint = 1;
private int minAccountLevelForBlockSubmissions;
private int minAccountLevelToRewardShare;
private int maxRewardSharesPerMintingAccount;
private int founderEffectiveMintingLevel;
@ -344,6 +345,10 @@ public class BlockChain {
return this.minAccountLevelToMint;
}
public int getMinAccountLevelForBlockSubmissions() {
return this.minAccountLevelForBlockSubmissions;
}
public int getMinAccountLevelToRewardShare() {
return this.minAccountLevelToRewardShare;
}

11
src/main/java/org/qortal/controller/BlockMinter.java

@ -47,11 +47,6 @@ public class BlockMinter extends Thread {
// Recovery
public static final long INVALID_BLOCK_RECOVERY_TIMEOUT = 10 * 60 * 1000L; // ms
// Min effective account level to submit blocks
// This is an unvalidated version of Blockchain.minAccountLevelToMint
// and exists only to reduce block candidates by default.
private static int MIN_EFFECTIVE_LEVEL_FOR_BLOCK_SUBMISSION = 6;
// Constructors
public BlockMinter() {
@ -136,9 +131,11 @@ public class BlockMinter extends Thread {
continue;
}
// Optional (non-validated) prevention of block submissions below a defined level
// Optional (non-validated) prevention of block submissions below a defined level.
// This is an unvalidated version of Blockchain.minAccountLevelToMint
// and exists only to reduce block candidates by default.
int level = mintingAccount.getEffectiveMintingLevel();
if (level < MIN_EFFECTIVE_LEVEL_FOR_BLOCK_SUBMISSION) {
if (level < BlockChain.getInstance().getMinAccountLevelForBlockSubmissions()) {
madi.remove();
continue;
}

1
src/main/resources/blockchain.json

@ -8,6 +8,7 @@
"requireGroupForApproval": false,
"defaultGroupId": 0,
"oneNamePerAccount": true,
"minAccountLevelForBlockSubmissions": 6,
"minAccountLevelToRewardShare": 5,
"maxRewardSharesPerMintingAccount": 6,
"founderEffectiveMintingLevel": 10,

Loading…
Cancel
Save