Skip to content

Commit

Permalink
1.4.5.1c-Leisure Upgrade
Browse files Browse the repository at this point in the history
- Add flag to allow user to forcefully join a campaign : exec join pog
nickname true
  • Loading branch information
biblepay committed Oct 30, 2019
1 parent 3bd6b9a commit a63bab6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2276,17 +2276,20 @@ UniValue exec(const JSONRPCRequest& request)
}
else if (sItem == "join")
{
if (request.params.size() != 2 && request.params.size() != 3)
throw std::runtime_error("You must specify the project_name. Optionally specify your nickname or sanctuary IP address.");
if (request.params.size() != 2 && request.params.size() != 3 && request.params.size() != 4)
throw std::runtime_error("Join v1.1: You must specify the project_name. Optionally specify your nickname or sanctuary IP address. Optionally specify force=true/false.");
std::string sProject = request.params[1].get_str();
std::string sOptData;
if (request.params.size() > 2)
sOptData = request.params[2].get_str();
bool fForce = false;
if (request.params.size() > 3)
fForce = request.params[3].get_str() == "true" ? true : false;
boost::to_lower(sProject);
std::string sError;
if (!CheckCampaign(sProject))
throw std::runtime_error("Campaign does not exist.");
bool fAdv = AdvertiseChristianPublicKeypair("cpk-" + sProject, "", sOptData, "", false, false, 0, "", sError);
bool fAdv = AdvertiseChristianPublicKeypair("cpk-" + sProject, "", sOptData, "", false, fForce, 0, "", sError);
results.push_back(Pair("Results", fAdv));
if (!fAdv)
results.push_back(Pair("Error", sError));
Expand Down

0 comments on commit a63bab6

Please sign in to comment.