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

Class BlockChain

code/chapter09/blockchain/blockchain7/core/src/blockchain.rs:16–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14const PRE_HASH: &str = "22caaf24ef0aea3522c13d133912d2b722caaf24ef0aea3522c13d133912d2b7";
15
16pub struct BlockChain {
17 blocks_db: Box<Database<BKey>>,
18 blocks_index: Mutex<HashMap<String, Block>>,
19 pub gnes_hash: String,
20 pub curr_hash: String,
21 pub curr_bits: u32,
22}
23
24impl BlockChain {
25 pub fn new() -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected