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

Method mining

publication/code/chapter10/blockchain/blockchain8/core/src/mine.rs:20–25  ·  view source on GitHub ↗
(&mut self, txs: &mut Vec<Transaction>)

Source from the content-addressed store, hash-verified

18 }
19
20 pub fn mining(&mut self, txs: &mut Vec<Transaction>) {
21 let pre_hash = self.blockchain.curr_hash.clone();
22 let bits = self.blockchain.curr_bits.clone();
23 let block = self.miner.mine_block(txs, pre_hash, bits);
24 self.blockchain.add_block(block);
25 }
26}

Callers 1

mainFunction · 0.45

Calls 2

mine_blockMethod · 0.45
add_blockMethod · 0.45

Tested by

no test coverage detected