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

Method prepare_data

code/chapter09/blockchain/blockchain2/core/src/pow.rs:63–66  ·  view source on GitHub ↗

准备区块头数据

(block: &mut Block, nonce: u32)

Source from the content-addressed store, hash-verified

61
62 // 准备区块头数据
63 fn prepare_data(block: &mut Block, nonce: u32) -> Vec<u8> {
64 block.header.nonce = nonce;
65 serialize(&(block.header))
66 }
67}

Callers

nothing calls this directly

Calls 1

serializeFunction · 0.50

Tested by

no test coverage detected