mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 06:55:08 +01:00
Only validate param change after parsing is done
This commit is contained in:
parent
0501412d8e
commit
bd3f999e5c
1 changed files with 7 additions and 3 deletions
|
@ -63,9 +63,13 @@ public class ChangeParamValidator extends ProposalValidator implements Consensus
|
||||||
public void validateDataFields(Proposal proposal) throws ProposalValidationException {
|
public void validateDataFields(Proposal proposal) throws ProposalValidationException {
|
||||||
try {
|
try {
|
||||||
super.validateDataFields(proposal);
|
super.validateDataFields(proposal);
|
||||||
ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal;
|
|
||||||
validateParamValue(changeParamProposal.getParam(), changeParamProposal.getParamValue(), getBlockHeight(proposal));
|
// Only once parsing is complete we can check for param changes
|
||||||
checkArgument(changeParamProposal.getParamValue().length() <= 200, "ParamValue must not exceed 200 chars");
|
if (daoStateService.isParseBlockChainComplete()) {
|
||||||
|
ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal;
|
||||||
|
validateParamValue(changeParamProposal.getParam(), changeParamProposal.getParamValue(), getBlockHeight(proposal));
|
||||||
|
checkArgument(changeParamProposal.getParamValue().length() <= 200, "ParamValue must not exceed 200 chars");
|
||||||
|
}
|
||||||
} catch (ProposalValidationException e) {
|
} catch (ProposalValidationException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue