public CoinConfig(dynamic config) { try { // set the coin data. Name = config.name; Symbol = config.symbol; Algorithm = config.algorithm; Site = string.IsNullOrEmpty(config.site) ? string.Empty : config.site; RpcUpdate = config.rpcupdate; Options = new CoinOptions(config.options); BlockExplorer = new BlockExplorerOptions(config.blockExplorer); Extra = config.extra; if (Name == null || Symbol == null || Algorithm == null) // make sure we have valid name, symbol and algorithm data. { Valid = false; } else { Valid = true; } } catch (Exception e) { Valid = false; Log.Logger.ForContext <CoinConfig>().Error("Error loading coin configuration: {0:l}", e.Message); } }
public CoinConfig(dynamic config) { try { // set the coin data. Name = config.name; Symbol = config.symbol; Algorithm = config.algorithm; Site = string.IsNullOrEmpty(config.site) ? string.Empty : config.site; Options = new CoinOptions(config.options); BlockExplorer = new BlockExplorerOptions(config.blockExplorer); Extra = config.extra; if (Name == null || Symbol == null || Algorithm == null) // make sure we have valid name, symbol and algorithm data. Valid = false; else Valid = true; } catch (Exception e) { Valid = false; Log.Logger.ForContext<CoinConfig>().Error("Error loading coin configuration: {0:l}", e.Message); } }