This commit is contained in:
Anton Evangelatov 2021-07-02 12:02:36 +02:00
parent 4194c7fa24
commit 96245c3cfa

View File

@ -9,16 +9,16 @@ func ApplyIfEnableLibP2P(r repo.Repo, opts ...Option) Option {
return ApplyIf(func(settings *Settings) bool {
lr, err := r.Lock(settings.nodeType)
if err != nil {
// log error
// TODO: log error
return false
}
c, err := lr.Config()
if err != nil {
// log error
// TODO: log error
return false
}
defer lr.Close()
defer lr.Close() //nolint:errcheck
switch settings.nodeType {
case repo.FullNode:
@ -26,14 +26,14 @@ func ApplyIfEnableLibP2P(r repo.Repo, opts ...Option) Option {
case repo.StorageMiner:
cfg, ok := c.(*config.StorageMiner)
if !ok {
// log error
// TODO: log error
return false
}
enableLibP2P := cfg.Subsystems.EnableStorageMarket
return enableLibP2P
default:
// log error
// TODO: log error
return false
}
}, opts...)