Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions common/src/main/java/org/tron/core/exception/TronError.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public enum ErrCode {
LOG_LOAD(1),
WITNESS_INIT(1),
RATE_LIMITER_INIT(1),
JDK_VERSION(1),
SOLID_NODE_INIT(0);
SOLID_NODE_INIT(0),
PARAMETER_INIT(1),
JDK_VERSION(1);

private final int code;

Expand Down
10 changes: 5 additions & 5 deletions framework/src/main/java/org/tron/core/config/args/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.tron.core.Constant.MIN_PROPOSAL_EXPIRE_TIME;
import static org.tron.core.config.Parameter.ChainConstant.BLOCK_PRODUCE_TIMEOUT_PERCENT;
import static org.tron.core.config.Parameter.ChainConstant.MAX_ACTIVE_WITNESS_NUM;
import static org.tron.core.exception.TronError.ErrCode.PARAMETER_INIT;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.ParameterDescription;
Expand Down Expand Up @@ -1288,17 +1289,16 @@ public static void setParam(final Config config) {

private static long getProposalExpirationTime(final Config config) {
if (config.hasPath(Constant.COMMITTEE_PROPOSAL_EXPIRE_TIME)) {
throw new IllegalArgumentException("It is not allowed to configure "
+ "commit.proposalExpireTime in config.conf, please set the value in "
+ "block.proposalExpireTime.");
throw new TronError("It is not allowed to configure committee.proposalExpireTime in "
+ "config.conf, please set the value in block.proposalExpireTime.", PARAMETER_INIT);
}
if (config.hasPath(Constant.BLOCK_PROPOSAL_EXPIRE_TIME)) {
long proposalExpireTime = config.getLong(Constant.BLOCK_PROPOSAL_EXPIRE_TIME);
if (proposalExpireTime <= MIN_PROPOSAL_EXPIRE_TIME
|| proposalExpireTime >= MAX_PROPOSAL_EXPIRE_TIME) {
throw new IllegalArgumentException("The value[block.proposalExpireTime] is only allowed to "
throw new TronError("The value[block.proposalExpireTime] is only allowed to "
+ "be greater than " + MIN_PROPOSAL_EXPIRE_TIME + " and less than "
+ MAX_PROPOSAL_EXPIRE_TIME + "!");
+ MAX_PROPOSAL_EXPIRE_TIME + "!", PARAMETER_INIT);
}
return proposalExpireTime;
} else {
Expand Down