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

Method has_block

src/Core/BlockChain.cpp:556–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554bool BlockChain::get_block(const Hash &bid, RawBlock *raw_block) const { return get_block(bid, nullptr, raw_block); }
555
556bool BlockChain::has_block(const Hash &bid) const {
557 platform::DB::Value ms;
558 auto key = BLOCK_PREFIX + DB::to_binary_key(bid.data, sizeof(bid.data)) + BLOCK_SUFFIX;
559 if (!m_db.get(key, ms))
560 return false;
561 return true;
562}
563
564void BlockChain::store_header(const Hash &bid, const api::BlockHeader &header) {
565 auto key = HEADER_PREFIX + DB::to_binary_key(bid.data, sizeof(bid.data)) + HEADER_SUFFIX;

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected