@ -258,6 +258,7 @@ static const CRPCCommand vRPCCommands[] =
{ "getnumpieces", &getnumpieces, false, true },
{ "listusernamespartial", &listusernamespartial, false, true },
{ "rescandirectmsgs", &rescandirectmsgs, false, true },
{ "recheckusertorrent", &recheckusertorrent, false, true },
};
CRPCTable::CRPCTable()
@ -210,5 +210,6 @@ extern json_spirit::Value getlasthave(const json_spirit::Array& params, bool fHe
extern json_spirit::Value getnumpieces(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listusernamespartial(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value rescandirectmsgs(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value recheckusertorrent(const json_spirit::Array& params, bool fHelp);
#endif
@ -1766,3 +1766,23 @@ Value rescandirectmsgs(const Array& params, bool fHelp)
return Value();
}
Value recheckusertorrent(const Array& params, bool fHelp)
{
if (fHelp || (params.size() != 1))
throw runtime_error(
"recheckusertorrent <username>\n"
"recheck all posts in a given torrent. this may be useful if\n"
"post validation rules became stricter");
string localUser = params[0].get_str();
torrent_handle h = getTorrentUser(localUser);
if( h.is_valid() ){
h.force_recheck();