mirror of
https://github.com/wownero/wownero.git
synced 2026-10-25 10:28:33 +01:00
rpc: remove last usage of txs_as_hex
This commit is contained in:
@@ -1006,23 +1006,20 @@ bool t_rpc_command_executor::print_transaction(crypto::hash transaction_hash,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 == res.txs.size() || 1 == res.txs_as_hex.size())
|
if (1 == res.txs.size())
|
||||||
{
|
{
|
||||||
if (1 == res.txs.size())
|
// only available for new style answers
|
||||||
{
|
static const std::string empty_hash = epee::string_tools::pod_to_hex(crypto::cn_fast_hash("", 0));
|
||||||
// only available for new style answers
|
// prunable_hash will equal empty_hash when nothing is prunable (mostly when the transaction is coinbase)
|
||||||
static const std::string empty_hash = epee::string_tools::pod_to_hex(crypto::cn_fast_hash("", 0));
|
bool pruned = res.txs.front().prunable_as_hex.empty() && res.txs.front().prunable_hash != epee::string_tools::pod_to_hex(crypto::null_hash) && res.txs.front().prunable_hash != empty_hash;
|
||||||
// prunable_hash will equal empty_hash when nothing is prunable (mostly when the transaction is coinbase)
|
if (res.txs.front().in_pool)
|
||||||
bool pruned = res.txs.front().prunable_as_hex.empty() && res.txs.front().prunable_hash != epee::string_tools::pod_to_hex(crypto::null_hash) && res.txs.front().prunable_hash != empty_hash;
|
tools::success_msg_writer() << "Found in pool";
|
||||||
if (res.txs.front().in_pool)
|
else
|
||||||
tools::success_msg_writer() << "Found in pool";
|
tools::success_msg_writer() << "Found in blockchain at height " << res.txs.front().block_height << (pruned ? " (pruned)" : "");
|
||||||
else
|
|
||||||
tools::success_msg_writer() << "Found in blockchain at height " << res.txs.front().block_height << (pruned ? " (pruned)" : "");
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string &as_hex = (1 == res.txs.size()) ? res.txs.front().as_hex : res.txs_as_hex.front();
|
const std::string &as_hex = res.txs.front().as_hex;
|
||||||
const std::string &pruned_as_hex = (1 == res.txs.size()) ? res.txs.front().pruned_as_hex : "";
|
const std::string &pruned_as_hex = res.txs.front().pruned_as_hex;
|
||||||
const std::string &prunable_as_hex = (1 == res.txs.size()) ? res.txs.front().prunable_as_hex : "";
|
const std::string &prunable_as_hex = res.txs.front().prunable_as_hex;
|
||||||
// Print metadata if requested
|
// Print metadata if requested
|
||||||
if (include_metadata)
|
if (include_metadata)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -418,6 +418,7 @@ inline const std::string get_rpc_status(const bool trusted_daemon, const std::st
|
|||||||
struct response_t: public rpc_access_response_base
|
struct response_t: public rpc_access_response_base
|
||||||
{
|
{
|
||||||
// older compatibility stuff
|
// older compatibility stuff
|
||||||
|
// TODO: remove after FCMP++ hf
|
||||||
std::vector<std::string> txs_as_hex; //transactions blobs as hex (old compat)
|
std::vector<std::string> txs_as_hex; //transactions blobs as hex (old compat)
|
||||||
std::vector<std::string> txs_as_json; //transactions decoded as json (old compat)
|
std::vector<std::string> txs_as_json; //transactions decoded as json (old compat)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user