Skip to content

Commit

Permalink
Fix nil exception in numUnits check
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Mar 1, 2024
1 parent a8a58c6 commit fdd5647
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/postcli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ ls -la ./data/*.bin | wc -l
1600
```

**Merging postmeta_data.json**: Every subset will create its own `postmeta_data.json`. These files MUST be merged manually.
During initialization a VRF nonce is searched that represents the index of the **the label with the smallest value**.
**Merging postdata_metadata.json**: Every subset will create its own `postdata_metadata.json`. These files MUST be
merged manually. During initialization a VRF nonce is searched that represents the index of the
**the label with the smallest value**.

When `postcli` initializes in chunks, each subset can find a valid VRF nonce, which represents the local minimum in the
initialized subset. It is **necessary** to manually select the best one (the global minimum) when merging the subsets.
Expand Down
2 changes: 1 addition & 1 deletion cmd/postcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func processFlags() {
log.Fatalln("-numUnits must be specified to perform initialization.")
}

if flagSet["numUnits"] && numUnits != uint64(meta.NumUnits) {
if flagSet["numUnits"] && meta != nil && numUnits != uint64(meta.NumUnits) {
log.Println("WARNING: it appears that", opts.DataDir, "was previously initialized with a different `numUnits` value.")
log.Println("\tCurrent value:", meta.NumUnits)
log.Println("\tValue passed to postcli:", numUnits)
Expand Down

0 comments on commit fdd5647

Please sign in to comment.