This commit is contained in:
Ivan Kuznetsov 2017-08-17 13:06:42 +07:00
parent 9104fae035
commit cc4a2d8b43
1 changed files with 2 additions and 2 deletions

View File

@ -25,8 +25,8 @@ func (b *Block) SetHash() {
} }
// NewBlock creates and returns Block // NewBlock creates and returns Block
func NewBlock(data string, prevBlock []byte) *Block { func NewBlock(data string, prevBlockHash []byte) *Block {
block := &Block{time.Now().Unix(), []byte(data), prevBlock, []byte{}} block := &Block{time.Now().Unix(), []byte(data), prevBlockHash, []byte{}}
block.SetHash() block.SetHash()
return block return block
} }