forked from Qortal/qortal
Default min level for block submissions increased to 3
This doesn't affect minting rewards; it is simply a means of reducing block candidates. There should be no noticeable difference other than hopefully less re-orgs. We can ultimately do a hard fork and increase Blockchain.minAccountLevelToMint but this allows us to test the approach in a lower risk way.
This commit is contained in:
parent
d018f11877
commit
cce95e09de
@ -16,6 +16,7 @@ import org.qortal.account.PrivateKeyAccount;
|
|||||||
import org.qortal.block.Block;
|
import org.qortal.block.Block;
|
||||||
import org.qortal.block.Block.ValidationResult;
|
import org.qortal.block.Block.ValidationResult;
|
||||||
import org.qortal.block.BlockChain;
|
import org.qortal.block.BlockChain;
|
||||||
|
import org.qortal.data.account.AccountData;
|
||||||
import org.qortal.data.account.MintingAccountData;
|
import org.qortal.data.account.MintingAccountData;
|
||||||
import org.qortal.data.account.RewardShareData;
|
import org.qortal.data.account.RewardShareData;
|
||||||
import org.qortal.data.block.BlockData;
|
import org.qortal.data.block.BlockData;
|
||||||
@ -47,6 +48,11 @@ 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 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_LEVEL_FOR_BLOCK_SUBMISSION = 3;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
public BlockMinter() {
|
public BlockMinter() {
|
||||||
@ -130,6 +136,16 @@ public class BlockMinter extends Thread {
|
|||||||
madi.remove();
|
madi.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Optional (non-validated) prevention of block submissions below a defined level
|
||||||
|
AccountData accountData = repository.getAccountRepository().getAccount(mintingAccount.getAddress());
|
||||||
|
if (accountData != null) {
|
||||||
|
Integer level = accountData.getLevel();
|
||||||
|
if (level != null && level < MIN_LEVEL_FOR_BLOCK_SUBMISSION) {
|
||||||
|
madi.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Peer> peers = Network.getInstance().getHandshakedPeers();
|
List<Peer> peers = Network.getInstance().getHandshakedPeers();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user