clean up redundant code

pull/61/head
Minh Doan 6 years ago
parent 33ef9a096b
commit c46424272c
  1. 12
      blockchain/block.go

@ -60,18 +60,6 @@ func (b *Block) String() string {
return res
}
// HashTransactions returns a hash of the transactions in the block
func (b *Block) HashTransactions() []byte {
var txHashes [][]byte
var txHash [32]byte
for _, tx := range b.Transactions {
txHashes = append(txHashes, tx.ID[:])
}
txHash = sha256.Sum256(bytes.Join(txHashes, []byte{}))
return txHash[:]
}
func (b *Block) Write(db db.Database, key string) error {
return db.Put([]byte(key), b.Serialize())
}

Loading…
Cancel
Save