|
8 | 8 | #include "budget/budgetutil.h" |
9 | 9 | #include "destination_io.h" |
10 | 10 | #include "guiconstants.h" |
| 11 | +#include "optional.h" |
11 | 12 | #include "qt/transactiontablemodel.h" |
12 | 13 | #include "qt/transactionrecord.h" |
13 | 14 | #include "qt/pivx/mnmodel.h" |
14 | 15 | #include "tiertwo/tiertwo_sync_state.h" |
15 | 16 | #include "utilmoneystr.h" |
16 | 17 | #include "utilstrencodings.h" |
| 18 | +#include "wallet/wallet.h" // TODO: Move to walletModel |
17 | 19 | #include "walletmodel.h" |
18 | 20 |
|
19 | 21 | #include <algorithm> |
@@ -262,14 +264,15 @@ OperationResult GovernanceModel::voteForProposal(const ProposalInfo& prop, |
262 | 264 | const std::vector<std::string>& mnVotingAlias) |
263 | 265 | { |
264 | 266 | UniValue ret; // future: don't use UniValue here. |
| 267 | + auto p_wallet = vpwallets[0]; // TODO: Move to walletModel |
| 268 | + bool fLegacyMN = walletModel->isRegTestNetwork() ? false : true; // For now, only DMN on regtest |
265 | 269 | for (const auto& mnAlias : mnVotingAlias) { |
266 | | - bool fLegacyMN = true; // For now, only legacy MNs |
267 | | - ret = mnBudgetVoteInner(nullptr, |
| 270 | + ret = mnBudgetVoteInner(p_wallet, |
268 | 271 | fLegacyMN, |
269 | 272 | prop.id, |
270 | 273 | false, |
271 | 274 | isVotePositive ? CBudgetVote::VoteDirection::VOTE_YES : CBudgetVote::VoteDirection::VOTE_NO, |
272 | | - mnAlias); |
| 275 | + fLegacyMN ? mnAlias : boost::optional<std::string>{}); |
273 | 276 | if (ret.exists("detail") && ret["detail"].isArray()) { |
274 | 277 | const UniValue& obj = ret["detail"].get_array()[0]; |
275 | 278 | if (obj["result"].getValStr() != "success") { |
|
0 commit comments