Skip to content

Commit

Permalink
Merge pull request #96 from cryptochangements34/rpc-tx_pool_json
Browse files Browse the repository at this point in the history
core rpc: allow omission of binary data in get_transaction_pool
  • Loading branch information
thaerkh authored Sep 17, 2018
2 parents 480beb2 + 6abe4a8 commit 0b29931
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rpc/core_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,15 @@ namespace cryptonote
return r;

m_core.get_pool_transactions_and_spent_keys_info(res.transactions, res.spent_key_images, !request_has_rpc_origin || !m_restricted);

if (req.json_only)
{
for(auto& tx: res.transactions)
{
tx.blob_size = 0;
tx.tx_blob = "";
}
}
res.status = CORE_RPC_STATUS_OK;
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/core_rpc_server_commands_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,9 @@ namespace cryptonote
{
struct request
{
bool json_only;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_OPT(json_only, false)
END_KV_SERIALIZE_MAP()
};

Expand Down

0 comments on commit 0b29931

Please sign in to comment.