aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/rpc_command_executor.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-01-31 15:19:40 +0200
committerRiccardo Spagni <ric@spagni.net>2016-01-31 15:19:40 +0200
commitac961f66f69642563fe46c3be40efdad521c2c4e (patch)
treec662b2241380a793c64c2f1254de14cdf34339c8 /src/daemon/rpc_command_executor.cpp
parentMerge pull request #629 (diff)
parentnew flush_txpool command, and associated RPC call (diff)
downloadmonero-ac961f66f69642563fe46c3be40efdad521c2c4e.tar.xz
Merge pull request #630
bf6d147 new flush_txpool command, and associated RPC call (moneromooo-monero) 6288295 rpc: add missing return on error when getting a tx (moneromooo-monero) b7e37b7 simplewallet: show_transfers can now show just failed txes (moneromooo-monero) b11539f wallet: detect and handle failed outgoing transfers (moneromooo-monero) 4b23714 tx_pool: serialize missing kept_by_block flag (moneromooo-monero)
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r--src/daemon/rpc_command_executor.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 6809f68b9..1ab1c8ed8 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -1161,4 +1161,34 @@ bool t_rpc_command_executor::unban(const std::string &ip)
return true;
}
+bool t_rpc_command_executor::flush_txpool(const std::string &txid)
+{
+ cryptonote::COMMAND_RPC_FLUSH_TRANSACTION_POOL::request req;
+ cryptonote::COMMAND_RPC_FLUSH_TRANSACTION_POOL::response res;
+ std::string fail_message = "Unsuccessful";
+ epee::json_rpc::error error_resp;
+
+ if (!txid.empty())
+ req.txids.push_back(txid);
+
+ if (m_is_rpc)
+ {
+ if (!m_rpc_client->json_rpc_request(req, res, "flush_txpool", fail_message.c_str()))
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (!m_rpc_server->on_flush_txpool(req, res, error_resp))
+ {
+ tools::fail_msg_writer() << fail_message.c_str();
+ return true;
+ }
+ }
+
+ return true;
+}
+
+
}// namespace daemonize