馬哥GO高并發(fā)
創(chuàng)建新區(qū)塊函數(shù)-NewBlock
//生成新區(qū)塊//TODO:body中的tx等作為參數(shù)傳入func NewBlock(header *Header, body *Body) *Block {
? ?b := &Block{header: CopyHeader(header), body: body}
? ?b.header.Timestamp = time.Now().Unix()
? ?b.header.Blockhash = b.SetHash()
? ?return b}
?
標(biāo)簽: