diff options
author | warptangent <warptangent@inbox.com> | 2015-04-23 05:13:07 -0700 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-04-23 07:04:36 -0700 |
commit | b76857f9d9a8bf45b854e9c3da56b550ade1a7c6 (patch) | |
tree | aead9c8412218045e3de48fe4b98a2bcc0393b67 /src/rpc | |
parent | update lmdb64 (diff) | |
download | monero-b76857f9d9a8bf45b854e9c3da56b550ade1a7c6.tar.xz |
Add mempool output to daemon via command and RPC
This is for the "print_pool" command and "get_transaction_pool" RPC
method.
Add mempool's spent key images to the results.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 4 | ||||
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 8eeac489d..561161950 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -401,10 +401,8 @@ namespace cryptonote //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::on_get_transaction_pool(const COMMAND_RPC_GET_TRANSACTION_POOL::request& req, COMMAND_RPC_GET_TRANSACTION_POOL::response& res) { - /* CHECK_CORE_BUSY(); - res.transactions = m_core.transaction_pool_info(); - */ + m_core.get_pool_transactions_and_spent_keys_info(res.transactions, res.spent_key_images); res.status = CORE_RPC_STATUS_OK; return true; } diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index e54dec2c9..b6a2edd0b 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -619,7 +619,18 @@ namespace cryptonote KV_SERIALIZE(receive_time) END_KV_SERIALIZE_MAP() }; - + + struct spent_key_image_info + { + std::string id_hash; + std::vector<std::string> txs_hashes; + + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(id_hash) + KV_SERIALIZE(txs_hashes) + END_KV_SERIALIZE_MAP() + }; + struct COMMAND_RPC_GET_TRANSACTION_POOL { struct request @@ -632,10 +643,12 @@ namespace cryptonote { std::string status; std::vector<tx_info> transactions; + std::vector<spent_key_image_info> spent_key_images; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(status) KV_SERIALIZE(transactions) + KV_SERIALIZE(spent_key_images) END_KV_SERIALIZE_MAP() }; }; |