change numbering on tx in mempool

master
moneroexamples 8 years ago
parent a4ab22486f
commit 1fe5a2185f

@ -810,11 +810,13 @@ namespace xmreg
{ {
// get all memmpool txs // get all memmpool txs
mempool_txs = MempoolStatus::get_mempool_txs(); mempool_txs = MempoolStatus::get_mempool_txs();
no_of_mempool_tx = mempool_txs.size();
} }
else else
{ {
// get only first no_of_mempool_tx txs // get only first no_of_mempool_tx txs
mempool_txs = MempoolStatus::get_mempool_txs(no_of_mempool_tx); mempool_txs = MempoolStatus::get_mempool_txs(no_of_mempool_tx);
no_of_mempool_tx = std::min(no_of_mempool_tx, mempool_txs.size());
} }
// total size of mempool in bytes // total size of mempool in bytes
@ -822,7 +824,7 @@ namespace xmreg
// reasign this number, in case no of txs in mempool is smaller // reasign this number, in case no of txs in mempool is smaller
// than what we requested or we want all txs. // than what we requested or we want all txs.
no_of_mempool_tx = mempool_txs.size();
uint64_t total_no_of_mempool_tx = MempoolStatus::mempool_no; uint64_t total_no_of_mempool_tx = MempoolStatus::mempool_no;
@ -908,7 +910,7 @@ namespace xmreg
// this is for partial disply on front page. // this is for partial disply on front page.
context["mempool_fits_on_front_page"] = (mempool_txs.size() <= total_no_of_mempool_tx); context["mempool_fits_on_front_page"] = (total_no_of_mempool_tx <= mempool_txs.size());
context["no_of_mempool_tx_of_frontpage"] = no_of_mempool_tx; context["no_of_mempool_tx_of_frontpage"] = no_of_mempool_tx;
context["partial_mempool_shown"] = true; context["partial_mempool_shown"] = true;
@ -5444,11 +5446,6 @@ namespace xmreg
MempoolStatus::network_info local_copy_network_info MempoolStatus::network_info local_copy_network_info
= MempoolStatus::current_network_info; = MempoolStatus::current_network_info;
if (local_copy_network_info.current == false)
{
return false;
}
j_info = json { j_info = json {
{"status" , local_copy_network_info.current}, {"status" , local_copy_network_info.current},
{"current" , local_copy_network_info.current}, {"current" , local_copy_network_info.current},
@ -5472,7 +5469,7 @@ namespace xmreg
{"fee_per_kb" , local_copy_network_info.fee_per_kb} {"fee_per_kb" , local_copy_network_info.fee_per_kb}
}; };
return true; return local_copy_network_info.current;
} }
bool bool

Loading…
Cancel
Save