public async Task <GetWalletInfoResponse> GetInfo(int currencyId) { using (var currencyRepo = new Repository <Currency>()) { var currency = await currencyRepo.GetOrDefaultAsync(x => x.Id == currencyId); if (currency == null) { Log.Message(LogLevel.Error, "[GetInfo] - Currency '{0}' not found.", currencyId); return(null); } try { //var wallet = new WalletConnector("127.0.0.1", 33113, "sa_ddam213.3", "213bit"); var wallet = new WalletConnector(currency.WalletHost, currency.WalletPort, currency.WalletUser, currency.WalletPass); var info = await wallet.GetInfoAsync(); var miningInfo = await wallet.GetMiningInfoAsync(); return(new GetWalletInfoResponse { InfoData = new GetInfoData { Blocks = info.Blocks, Connections = info.Connections, Difficulty = info.Difficulty, Hashrate = miningInfo.NetworkHashrate }, PeerInfo = new List <PeerInfo>(await wallet.GetPeerInfoAsync()) }); } catch (Exception ex) { Log.Exception("[GetInfo] - An exception occured during GetInfo, CurrencyId: {0}.", ex, currencyId); } return(null); } }