Handle review changes

This commit is contained in:
neeraj
2023-10-19 10:09:34 +05:30
parent 71c028435d
commit f2f951f7b8
3 changed files with 15 additions and 10 deletions
+9 -4
View File
@@ -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 {