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 4, 2023
1 parent 8546cbf commit fb405d3
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 @@ -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()
Expand Down

0 comments on commit fb405d3

Please sign in to comment.