new flush_txpool command, and associated RPC call

It can flush a particular tx, or the whole pool (the RPC command
can flush a list of transactions too)
This commit is contained in:
moneromooo-monero
2016-01-30 13:28:26 +00:00
parent 6288295f8e
commit bf6d1474c0
12 changed files with 175 additions and 0 deletions

View File

@@ -421,5 +421,23 @@ bool t_command_parser_executor::unban(const std::vector<std::string>& args)
return m_executor.unban(ip);
}
bool t_command_parser_executor::flush_txpool(const std::vector<std::string>& args)
{
if (args.size() > 1) return false;
std::string txid;
if (args.size() == 1)
{
crypto::hash hash;
if (!parse_hash256(args[0], hash))
{
std::cout << "failed to parse tx id" << std::endl;
return true;
}
txid = args[0];
}
return m_executor.flush_txpool(txid);
}
} // namespace daemonize