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

Method get_timestamp_lower_bound_height

src/Core/BlockChain.cpp:411–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411Height BlockChain::get_timestamp_lower_bound_height(Timestamp ts) const {
412 auto middle = common::write_varint_sqlite4(ts);
413 DB::Cursor cur = m_db.begin(TIMESTAMP_BLOCK_PREFIX, middle);
414 if (cur.end())
415 return m_tip_height + 1;
416 const char *be = cur.get_suffix().data();
417 const char *en = be + cur.get_suffix().size();
418 common::read_varint_sqlite4(be, en); // We ignore result, auto actual_ts =
419 return common::integer_cast<Height>(common::read_varint_sqlite4(be, en));
420}
421
422std::vector<Hash> BlockChain::get_sync_headers_chain(
423 const std::vector<Hash> &locator, Height *start_height, size_t max_count) const {

Callers 1

Calls 6

write_varint_sqlite4Function · 0.85
read_varint_sqlite4Function · 0.50
beginMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected