forked from cerc-io/ipld-eth-server
Handle review changes
This commit is contained in:
+9
-4
@@ -113,7 +113,6 @@ func serve() {
|
||||
pm.Start(wg)
|
||||
defer pm.Stop()
|
||||
|
||||
rpcPort := nitroConfig.InProcessNode.RpcPort
|
||||
tlsCertFilepath := nitroConfig.InProcessNode.TlsCertFilepath
|
||||
tlsKeyFilepath := nitroConfig.InProcessNode.TlsKeyFilepath
|
||||
|
||||
@@ -125,7 +124,7 @@ func serve() {
|
||||
}
|
||||
}
|
||||
|
||||
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, cert, rpcPort)
|
||||
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, cert, nitroConfig.InProcessNode.RpcPort)
|
||||
if err != nil {
|
||||
logWithCommand.Fatal(err)
|
||||
}
|
||||
@@ -513,18 +512,24 @@ func initNitroRpcServer(node *nitroNode.Node, pm paymentsmanager.PaymentsManager
|
||||
}
|
||||
|
||||
func readRpcQueryRates(filepath string) (map[string]*big.Int, error) {
|
||||
result := make(map[string]*big.Int)
|
||||
|
||||
if filepath == "" {
|
||||
logWithCommand.Warn("RPC query rates file path not provided")
|
||||
return result, nil
|
||||
}
|
||||
|
||||
jsonFile, err := os.Open(filepath)
|
||||
defer jsonFile.Close()
|
||||
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
result := make(map[string]*big.Int)
|
||||
logWithCommand.Warn("RPC query rates file does not exist")
|
||||
return result, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var result map[string]*big.Int
|
||||
decoder := json.NewDecoder(jsonFile)
|
||||
err = decoder.Decode(&result)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user