/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
"bytes"
"encoding/json"
"errors"
+ "fmt"
"log"
"os"
"path"
}
var freqPath *string
- freqChunked := int64(MaxFileSize)
+ var freqChunked int64
var freqMinSize int64
freqMaxSize := int64(MaxFileSize)
if cfg.Freq != nil {
copy(area.Pub[:], pub)
}
if cfg.Prv != nil {
+ if area.Pub == nil {
+ return nil, fmt.Errorf("area %s: prv requires pub presence", name)
+ }
prv, err := Base32Codec.DecodeString(*cfg.Prv)
if err != nil {
return nil, err