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

Method get_block_hash

src/CryptoNote.cpp:531–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531Hash cn::get_block_hash(const BlockHeader &bh, const BlockBodyProxy &body_proxy) {
532 // get_object_hash prepends array size before hashing.
533 // this was a mistake of initial cryptonote developers
534 Hash ha2 = get_object_hash(seria::to_binary(bh, BlockSeriaType::BLOCKHASH, body_proxy), nullptr);
535 // std::cout << "ha: " << ha2 << " ba: " << common::to_hex(seria::to_binary(bh, BlockSeriaType::BLOCKHASH,
536 // body_proxy)) << std::endl;
537 return ha2;
538}
539
540Hash cn::get_block_header_prehash(const BlockHeader &bh, const BlockBodyProxy &body_proxy) {
541 // get_object_hash prepends array size before hashing.

Callers

nothing calls this directly

Calls 2

get_object_hashFunction · 0.85
to_binaryFunction · 0.85

Tested by

no test coverage detected