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

Method write_tail

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

Source from the content-addressed store, hash-verified

85 }
86
87 fn write_tail(mut db: &mut Database<BKey>, block: &Block) {
88 let key = BKey{ val: U256::from("tail".as_bytes()) };
89 let val = serialize(&(block.hash));
90 BlockChainDb::write_db(&mut db, key, &val);
91 }
92
93 pub fn block_info(&self) {
94 let mut hash = self.curr_hash.clone();

Callers

nothing calls this directly

Calls 1

serializeFunction · 0.50

Tested by

no test coverage detected