remove make_tx_from_json

master
moneroexamples 7 years ago
parent d56f2d8c4d
commit c8cfe9ac4a

@ -35,48 +35,48 @@ MempoolStatus::start_mempool_status_thread()
{ {
uint64_t loop_index {0}; uint64_t loop_index {0};
// so that network status is checked every minute // so that network status is checked every minute
uint64_t loop_index_divider = std::max<uint64_t>(1, 60 / mempool_refresh_time); uint64_t loop_index_divider = std::max<uint64_t>(1, 60 / mempool_refresh_time);
while (true) while (true)
{ {
// we just query network status every minute. No sense // we just query network status every minute. No sense
// to do it as frequently as getting mempool data. // to do it as frequently as getting mempool data.
if (loop_index % loop_index_divider == 0) if (loop_index % loop_index_divider == 0)
{
if (!MempoolStatus::read_network_info())
{ {
if (!MempoolStatus::read_network_info()) network_info local_copy = current_network_info;
{
network_info local_copy = current_network_info;
cerr << " Cant read network info "<< endl; cerr << " Cant read network info "<< endl;
local_copy.current = false; local_copy.current = false;
current_network_info = local_copy; current_network_info = local_copy;
}
else
{
cout << "Current network info read, ";
loop_index = 0;
}
} }
else
if (MempoolStatus::read_mempool())
{ {
vector<mempool_tx> current_mempool_txs = get_mempool_txs(); cout << "Current network info read, ";
loop_index = 0;
cout << "mempool status txs: "
<< current_mempool_txs.size()
<< endl;
} }
}
if (MempoolStatus::read_mempool())
{
vector<mempool_tx> current_mempool_txs = get_mempool_txs();
cout << "mempool status txs: "
<< current_mempool_txs.size()
<< endl;
}
// when we reach top of the blockchain, update // when we reach top of the blockchain, update
// the emission amount every minute. // the emission amount every minute.
boost::this_thread::sleep_for( boost::this_thread::sleep_for(
boost::chrono::seconds(mempool_refresh_time)); boost::chrono::seconds(mempool_refresh_time));
++loop_index; ++loop_index;
} // while (true) } // while (true)
} }
@ -84,7 +84,7 @@ MempoolStatus::start_mempool_status_thread()
{ {
cout << "Mempool status thread interrupted." << endl; cout << "Mempool status thread interrupted." << endl;
return; return;
} }
}}; // m_thread = boost::thread{[]() }}; // m_thread = boost::thread{[]()
@ -137,7 +137,6 @@ MempoolStatus::read_mempool()
return false; return false;
} }
mempool_size_kB += _tx_info.blob_size; mempool_size_kB += _tx_info.blob_size;
local_copy_of_mempool_txs.push_back(mempool_tx {tx_hash, tx}); local_copy_of_mempool_txs.push_back(mempool_tx {tx_hash, tx});

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save