mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +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 {
|
||||
try {
|
||||
super.validateDataFields(proposal);
|
||||
ChangeParamProposal changeParamProposal = (ChangeParamProposal) proposal;
|
||||
validateParamValue(changeParamProposal.getParam(), changeParamProposal.getParamValue(), getBlockHeight(proposal));
|
||||
checkArgument(changeParamProposal.getParamValue().length() <= 200, "ParamValue must not exceed 200 chars");
|
||||
|
||||
// Only once parsing is complete we can check for param changes
|
||||
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) {
|
||||
throw e;
|
||||
} catch (Throwable throwable) {
|
||||
|
|
Loading…
Add table
Reference in a new issue