minAccountLevelForBlockSubmissions moved to blockchain.json

This commit is contained in:
CalDescent 2022-01-29 22:57:22 +00:00
parent d4ff7bbe4d
commit a35e309a2f
3 changed files with 10 additions and 7 deletions

View File

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

View File

@ -47,11 +47,6 @@ public class BlockMinter extends Thread {
// Recovery // Recovery
public static final long INVALID_BLOCK_RECOVERY_TIMEOUT = 10 * 60 * 1000L; // ms 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 // Constructors
public BlockMinter() { public BlockMinter() {
@ -136,9 +131,11 @@ public class BlockMinter extends Thread {
continue; 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(); int level = mintingAccount.getEffectiveMintingLevel();
if (level < MIN_EFFECTIVE_LEVEL_FOR_BLOCK_SUBMISSION) { if (level < BlockChain.getInstance().getMinAccountLevelForBlockSubmissions()) {
madi.remove(); madi.remove();
continue; continue;
} }

View File

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