setspammsg rpc

This commit is contained in:
Miguel Freitas 2013-09-20 19:51:56 -03:00
parent 5e68d4e2ae
commit 2e1c79a4c8
3 changed files with 17 additions and 0 deletions

View File

@ -241,6 +241,7 @@ static const CRPCCommand vRPCCommands[] =
{ "newdirectmsg", &newdirectmsg, false, true },
{ "newrtmsg", &newrtmsg, false, true },
{ "getposts", &getposts, false, true },
{ "setspammsg", &setspammsg, false, true },
};
CRPCTable::CRPCTable()

View File

@ -198,5 +198,6 @@ extern json_spirit::Value newpostmsg(const json_spirit::Array& params, bool fHel
extern json_spirit::Value newdirectmsg(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value newrtmsg(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getposts(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value setspammsg(const json_spirit::Array& params, bool fHelp);
#endif

View File

@ -1138,3 +1138,18 @@ Value getposts(const Array& params, bool fHelp)
return ret;
}
Value setspammsg(const Array& params, bool fHelp)
{
if (fHelp || (params.size() != 2))
throw runtime_error(
"setspammsg <username> <msg>\n"
"Set spam message attached to generated blocks");
string strUsername = params[0].get_str();
string strMsg = params[1].get_str();
strSpamUser = strUsername;
strSpamMessage = strMsg;
return Value();
}