Skip to content

Commit

Permalink
Add missing scrypt to metadata in initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Aug 12, 2023
1 parent 90bc4e4 commit a505c2e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions initialization/initialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -681,13 +681,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()
Expand Down

0 comments on commit a505c2e

Please sign in to comment.