From fb405d324d4c9da4dc2058d4215fbb9832e58d43 Mon Sep 17 00:00:00 2001 From: Matthias <5011972+fasmat@users.noreply.github.com> Date: Fri, 4 Aug 2023 09:20:26 +0000 Subject: [PATCH] Add missing scrypt to metadata in initializer --- initialization/initialization.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/initialization/initialization.go b/initialization/initialization.go index 20a01b851..60233a52d 100644 --- a/initialization/initialization.go +++ b/initialization/initialization.go @@ -171,8 +171,8 @@ type Initializer struct { // these values are atomics so they can be read from multiple other goroutines safely // write is protected by mtx - nonceValue atomic.Pointer[[]byte] nonce atomic.Pointer[uint64] + nonceValue atomic.Pointer[[]byte] lastPosition atomic.Pointer[uint64] numLabelsWritten atomic.Uint64 @@ -678,13 +678,18 @@ func (init *Initializer) verifyMetadata(m *shared.PostMetadata) error { func (init *Initializer) saveMetadata() error { v := shared.PostMetadata{ + Version: 1, + NodeId: init.nodeId, CommitmentAtxId: init.commitmentAtxId, - LabelsPerUnit: init.cfg.LabelsPerUnit, - NumUnits: init.opts.NumUnits, - MaxFileSize: init.opts.MaxFileSize, - Nonce: init.nonce.Load(), - LastPosition: init.lastPosition.Load(), + + LabelsPerUnit: init.cfg.LabelsPerUnit, + NumUnits: init.opts.NumUnits, + MaxFileSize: init.opts.MaxFileSize, + Scrypt: init.opts.Scrypt, + + Nonce: init.nonce.Load(), + LastPosition: init.lastPosition.Load(), } if init.nonceValue.Load() != nil { v.NonceValue = *init.nonceValue.Load()