MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / write_tail

Method write_tail

code/chapter09/blockchain/blockchain5/core/src/blockchain.rs:62–66  ·  view source on GitHub ↗
(mut db: &mut Database<BKey>, block: &Block)

Source from the content-addressed store, hash-verified

60 }
61
62 fn write_tail(mut db: &mut Database<BKey>, block: &Block) {
63 let key = BKey{ val: U256::from("tail".as_bytes()) };
64 let val = serialize(&(block.hash));
65 BlockChainDb::write_db(&mut db, key, &val);
66 }
67
68 pub fn block_info(&self) {
69 for b in self.blocks.iter() {

Callers

nothing calls this directly

Calls 1

serializeFunction · 0.50

Tested by

no test coverage detected