diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 44a634dc..989af8ea 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -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() diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index 34147485..6525276f 100644 --- a/src/bitcoinrpc.h +++ b/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 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 diff --git a/src/twister.cpp b/src/twister.cpp index acde7da4..fef23631 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -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 \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(); +} + +