diff --git a/pkg/config/config.go b/pkg/config/config.go index 47318828c..0accd2710 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -78,8 +78,7 @@ func LoadFile(configPath string) (Config, error) { PingTimeout: 90 * time.Second, }, RPC: RPC{ - MaxFindStorageResultItems: DefaultMaxFindStorageResultItems, - MaxNEP11Tokens: 100, + MaxNEP11Tokens: 100, }, }, } diff --git a/pkg/services/rpcsrv/server.go b/pkg/services/rpcsrv/server.go index d1f1a00c5..fa6a4af11 100644 --- a/pkg/services/rpcsrv/server.go +++ b/pkg/services/rpcsrv/server.go @@ -303,6 +303,10 @@ func New(chain Ledger, conf config.RPC, coreServer *network.Server, conf.MaxFindResultItems = config.DefaultMaxFindResultItems log.Info("MaxFindResultItems is not set or wrong, setting default value", zap.Int("MaxFindResultItems", config.DefaultMaxFindResultItems)) } + if conf.MaxFindStorageResultItems <= 0 { + conf.MaxFindStorageResultItems = config.DefaultMaxFindStorageResultItems + log.Info("MaxFindStorageResultItems is not set or wrong, setting default value", zap.Int("MaxFindStorageResultItems", config.DefaultMaxFindStorageResultItems)) + } if conf.MaxWebSocketClients == 0 { conf.MaxWebSocketClients = defaultMaxWebSocketClients log.Info("MaxWebSocketClients is not set or wrong, setting default value", zap.Int("MaxWebSocketClients", defaultMaxWebSocketClients))