| 554 | bool BlockChain::get_block(const Hash &bid, RawBlock *raw_block) const { return get_block(bid, nullptr, raw_block); } |
| 555 | |
| 556 | bool 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 | |
| 564 | void 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; |