示例#1
0
func (data *Data) Hash() []byte {
	if data.hash == nil {
		bs := make([]interface{}, len(data.Txs))
		for i, tx := range data.Txs {
			bs[i] = account.SignBytes(tx)
		}
		data.hash = merkle.HashFromBinaries(bs)
	}
	return data.hash
}
示例#2
0
func (v *Validation) Hash() []byte {
	if v.hash == nil {
		bs := make([]interface{}, len(v.Commits))
		for i, commit := range v.Commits {
			bs[i] = commit
		}
		v.hash = merkle.HashFromBinaries(bs)
	}
	return v.hash
}