MCPcopy Create free account
hub / github.com/bcndev/bytecoin / fill_statistics

Method fill_statistics

src/Core/BlockChain.cpp:1252–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1250}
1251
1252void BlockChain::fill_statistics(api::cnd::GetStatistics::Response &res) const {
1253 res.checkpoints = get_latest_checkpoints();
1254
1255 if (!m_currency.wish_to_upgrade())
1256 return;
1257 auto bit = m_blods.find(get_tip_bid());
1258 if (bit == m_blods.end())
1259 return;
1260 res.upgrade_decided_height = bit->second.upgrade_decided_height;
1261 auto count = std::count(bit->second.votes_for_upgrade_in_voting_window.begin(),
1262 bit->second.votes_for_upgrade_in_voting_window.end(), uint8_t(1));
1263 res.upgrade_votes_in_top_block = static_cast<Height>(count);
1264}
1265
1266bool BlockChain::fill_next_block_versions(
1267 const api::BlockHeader &prev_info, uint8_t *major_mm, uint8_t *major_cm) const {

Callers 1

Calls 3

wish_to_upgradeMethod · 0.80
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected