Hash() creates a hash representative of the dex batch
()
| 15 | |
| 16 | // Hash() creates a hash representative of the dex batch |
| 17 | func (x *DexBatch) Hash() []byte { |
| 18 | if x == nil { |
| 19 | return bytes.Clone(EmptyReceiptsHash) |
| 20 | } |
| 21 | if x.IsEmpty() { |
| 22 | x.ReceiptHash = bytes.Clone(EmptyReceiptsHash) |
| 23 | } |
| 24 | bz, _ := Marshal(x.Copy()) |
| 25 | return crypto.Hash(bz) |
| 26 | } |
| 27 | |
| 28 | // Copy() returns a copy, omitting non-critical information |
| 29 | func (x *DexBatch) Copy() *DexBatch { |