Skip to content

Commit 11c279c

Browse files
committed
Add CheckString for proposals
1 parent 4df4ca8 commit 11c279c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/budget/budgetproposal.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "budget/budgetproposal.h"
77
#include "chainparams.h"
8+
#include "logging.h"
89
#include "script/standard.h"
910
#include "utilstrencodings.h"
1011

@@ -146,9 +147,6 @@ bool CBudgetProposal::CheckAddress(const int nCurrentHeight)
146147
return true;
147148
}
148149

149-
/* TODO: Add this to IsWellFormed() for the next hard-fork
150-
* This will networkly reject malformed proposal names and URLs
151-
*/
152150
bool CBudgetProposal::CheckStrings()
153151
{
154152
if (strProposalName != SanitizeString(strProposalName)) {
@@ -157,11 +155,17 @@ bool CBudgetProposal::CheckStrings()
157155
}
158156
if (strURL != SanitizeString(strURL)) {
159157
strInvalid = "Proposal URL contains illegal characters.";
158+
return false;
160159
}
160+
return true;
161161
}
162162

163163
bool CBudgetProposal::IsWellFormed(const CAmount& nTotalBudget, const int nCurrentHeight)
164164
{
165+
bool isV6Enforced = Params().GetConsensus().NetworkUpgradeActive(nCurrentHeight, Consensus::UPGRADE_V6_0);
166+
if (isV6Enforced && !CheckStrings()) {
167+
return false;
168+
}
165169
return CheckStartEnd() && CheckAmount(nTotalBudget) && CheckAddress(nCurrentHeight);
166170
}
167171

0 commit comments

Comments
 (0)