json_mempool uses mempoolstatus thread

This commit is contained in:
moneroexamples 2017-06-02 09:26:55 +08:00
parent 20a6df212a
commit 6439838103
3 changed files with 5 additions and 15 deletions

View File

@ -112,7 +112,7 @@ MempoolStatus::read_mempool()
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))

View File

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

View File

@ -4502,19 +4502,9 @@ namespace xmreg
uint64_t height = core_storage->get_current_blockchain_height();
vector<pair<tx_info, transaction>> mempool_data;
crypto::hash tx_hash_dummy = null_hash;
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;
// get mempool tx from mempoolstatus thread
vector<MempoolStatus::mempool_tx> mempool_data
= MempoolStatus::get_mempool_txs();
uint64_t no_mempool_txs = mempool_data.size();