|
14 | 14 | #include "masternodeman.h" |
15 | 15 | #include "rpcserver.h" |
16 | 16 | #include "utilmoneystr.h" |
17 | | - |
| 17 | +#include <string> |
| 18 | +#include <iostream> |
18 | 19 | #include <fstream> |
19 | 20 | using namespace json_spirit; |
20 | 21 | using namespace std; |
@@ -66,9 +67,17 @@ Value mnbudget(const Array& params, bool fHelp) |
66 | 67 | if (strURL.size() > 64) |
67 | 68 | return "Invalid url, limit of 64 characters."; |
68 | 69 |
|
| 70 | + std::string nPaymenttext = params[3].get_str(); |
| 71 | + int nPaymentCount = std::stoi(nPaymenttext); |
| 72 | + //LogPrintf("nPaymentCount %d",nPaymentCount); |
| 73 | + if (nPaymentCount < 1 || nPaymentCount > 12) |
| 74 | + return "Invalid payment count, must be more than zero or few than 13"; |
| 75 | + /* |
| 76 | + This part works not. |
69 | 77 | int nPaymentCount = params[3].get_int(); |
70 | 78 | if (nPaymentCount < 1) |
71 | 79 | return "Invalid payment count, must be more than zero."; |
| 80 | + */ |
72 | 81 |
|
73 | 82 | //set block min |
74 | 83 | if (pindexPrev != NULL) nBlockMin = pindexPrev->nHeight - GetBudgetPaymentCycleBlocks() * (nPaymentCount + 1); |
@@ -142,9 +151,18 @@ Value mnbudget(const Array& params, bool fHelp) |
142 | 151 | if (strURL.size() > 64) |
143 | 152 | return "Invalid url, limit of 64 characters."; |
144 | 153 |
|
| 154 | + std::string nPaymenttext = params[3].get_str(); |
| 155 | + int nPaymentCount = std::stoi(nPaymenttext); |
| 156 | + //LogPrintf("nPaymentCount %d",nPaymentCount); |
| 157 | + if (nPaymentCount < 1 || nPaymentCount > 12) |
| 158 | + return "Invalid payment count, must be more than zero or few than 13"; |
| 159 | + |
| 160 | + /* |
| 161 | + This part works not. |
145 | 162 | int nPaymentCount = params[3].get_int(); |
146 | 163 | if (nPaymentCount < 1) |
147 | | - return "Invalid payment count, must be more than zero."; |
| 164 | + return "Invalid payment count, must be more than zero."; |
| 165 | + */ |
148 | 166 |
|
149 | 167 | //set block min |
150 | 168 | if (pindexPrev != NULL) nBlockMin = pindexPrev->nHeight - GetBudgetPaymentCycleBlocks() * (nPaymentCount + 1); |
|
0 commit comments