Add node ID field to file structure

This commit is contained in:
Kleissner
2021-09-28 19:55:30 +02:00
parent 608dbf6f47
commit 2c20fa950d
6 changed files with 22 additions and 10 deletions

View File

@@ -159,6 +159,9 @@ func createTestResult(fileType int) (file core.BlockRecordFile) {
file.ID = uuid.New()
file.Size = uint64(len(randomData))
file.NodeID = make([]byte, 32) // node ID = blake3 hash of peer ID
rand.Read(file.NodeID)
if fileType == -1 {
switch file.Format {
case core.FormatCSV, core.FormatEmail, core.FormatText, core.FormatHTML: