Browse Source

recheckusertorrent rpc

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
36da093939
  1. 1
      src/bitcoinrpc.cpp
  2. 1
      src/bitcoinrpc.h
  3. 20
      src/twister.cpp

1
src/bitcoinrpc.cpp

@ -258,6 +258,7 @@ static const CRPCCommand vRPCCommands[] =
{ "getnumpieces", &getnumpieces, false, true }, { "getnumpieces", &getnumpieces, false, true },
{ "listusernamespartial", &listusernamespartial, false, true }, { "listusernamespartial", &listusernamespartial, false, true },
{ "rescandirectmsgs", &rescandirectmsgs, false, true }, { "rescandirectmsgs", &rescandirectmsgs, false, true },
{ "recheckusertorrent", &recheckusertorrent, false, true },
}; };
CRPCTable::CRPCTable() CRPCTable::CRPCTable()

1
src/bitcoinrpc.h

@ -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 getnumpieces(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value listusernamespartial(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 rescandirectmsgs(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value recheckusertorrent(const json_spirit::Array& params, bool fHelp);
#endif #endif

20
src/twister.cpp

@ -1766,3 +1766,23 @@ Value rescandirectmsgs(const Array& params, bool fHelp)
return Value(); 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();
}
return Value();
}

Loading…
Cancel
Save