aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/command_parser_executor.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-01-30 13:28:26 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-01-30 13:28:26 +0000
commitbf6d1474c097ee0affe827fe2e3dac489b290f40 (patch)
treec662b2241380a793c64c2f1254de14cdf34339c8 /src/daemon/command_parser_executor.cpp
parentrpc: add missing return on error when getting a tx (diff)
downloadmonero-bf6d1474c097ee0affe827fe2e3dac489b290f40.tar.xz
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)
Diffstat (limited to '')
-rw-r--r--src/daemon/command_parser_executor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index d1d48b6da..0b42257e7 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -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