File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 66#include " budget/budgetproposal.h"
77#include " chainparams.h"
88#include " script/standard.h"
9+ #include " utilstrencodings.h"
910
1011CBudgetProposal::CBudgetProposal ():
1112 nAllotted(0 ),
@@ -145,6 +146,20 @@ bool CBudgetProposal::CheckAddress()
145146 return true ;
146147}
147148
149+ /* TODO: Add this to IsWellFormed() for the next hard-fork
150+ * This will networkly reject malformed proposal names and URLs
151+ */
152+ bool CBudgetProposal::CheckStrings ()
153+ {
154+ if (strProposalName != SanitizeString (strProposalName)) {
155+ strInvalid = " Proposal name contains illegal characters." ;
156+ return false ;
157+ }
158+ if (strURL != SanitizeString (strURL)) {
159+ strInvalid = " Proposal URL contains illegal characters." ;
160+ }
161+ }
162+
148163bool CBudgetProposal::IsWellFormed (const CAmount& nTotalBudget)
149164{
150165 return CheckStartEnd () && CheckAmount (nTotalBudget) && CheckAddress ();
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ class CBudgetProposal
4242 bool CheckStartEnd ();
4343 bool CheckAmount (const CAmount& nTotalBudget);
4444 bool CheckAddress ();
45+ bool CheckStrings ();
4546
4647protected:
4748 std::map<COutPoint, CBudgetVote> mapVotes;
You can’t perform that action at this time.
0 commit comments