json_mempool uses mempoolstatus thread

master
moneroexamples 8 years ago
parent 20a6df212a
commit 6439838103

@ -112,7 +112,7 @@ MempoolStatus::read_mempool()
return false; return false;
} }
local_copy_of_mempool_txs.emplace_back(_tx_info.receive_time, tx); local_copy_of_mempool_txs.emplace_back(_tx_info, tx);
} // if (hex_to_pod(_tx_info.id_hash, mem_tx_hash)) } // if (hex_to_pod(_tx_info.id_hash, mem_tx_hash))

@ -22,7 +22,7 @@ namespace xmreg
struct MempoolStatus struct MempoolStatus
{ {
using mempool_tx = pair<uint64_t, transaction>; using mempool_tx = pair<tx_info, transaction>;
static boost::thread m_thread; static boost::thread m_thread;

@ -4502,19 +4502,9 @@ namespace xmreg
uint64_t height = core_storage->get_current_blockchain_height(); uint64_t height = core_storage->get_current_blockchain_height();
vector<pair<tx_info, transaction>> mempool_data; // get mempool tx from mempoolstatus thread
vector<MempoolStatus::mempool_tx> mempool_data
crypto::hash tx_hash_dummy = null_hash; = MempoolStatus::get_mempool_txs();
if (!search_mempool(tx_hash_dummy, mempool_data))
{
j_response["status"] = "error";
j_response["message"] = fmt::format("Cant connect to the mempool");
return j_response;
}
(void) tx_hash_dummy;
uint64_t no_mempool_txs = mempool_data.size(); uint64_t no_mempool_txs = mempool_data.size();

Loading…
Cancel
Save