mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
remove make_tx_from_json
This commit is contained in:
parent
d56f2d8c4d
commit
c8cfe9ac4a
2 changed files with 1160 additions and 1434 deletions
|
@ -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
|
||||||
|
// to do it as frequently as getting mempool data.
|
||||||
|
if (loop_index % loop_index_divider == 0)
|
||||||
{
|
{
|
||||||
|
if (!MempoolStatus::read_network_info())
|
||||||
// we just query network status every minute. No sense
|
|
||||||
// to do it as frequently as getting mempool data.
|
|
||||||
if (loop_index % loop_index_divider == 0)
|
|
||||||
{
|
{
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// when we reach top of the blockchain, update
|
if (MempoolStatus::read_mempool())
|
||||||
// the emission amount every minute.
|
{
|
||||||
boost::this_thread::sleep_for(
|
vector<mempool_tx> current_mempool_txs = get_mempool_txs();
|
||||||
boost::chrono::seconds(mempool_refresh_time));
|
|
||||||
|
|
||||||
++loop_index;
|
cout << "mempool status txs: "
|
||||||
|
<< current_mempool_txs.size()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// when we reach top of the blockchain, update
|
||||||
|
// the emission amount every minute.
|
||||||
|
boost::this_thread::sleep_for(
|
||||||
|
boost::chrono::seconds(mempool_refresh_time));
|
||||||
|
|
||||||
|
++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});
|
||||||
|
|
2529
src/tools.cpp
2529
src/tools.cpp
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue