public async void updateWallet() { timeNow = DateTime.Now; try { WalletText.Text = await BitcoinTracking.GetWalletValue(lastPrice, address); } catch (Exception e) { address = DefaultAddress; MessageBox.Show(e.ToString()); } }
private async void CoinDeskAPITimer_Tick(object sender, EventArgs e) { newPrice = await BitcoinTracking.GetPrice(newPrice); CoinPrice = string.Format("1 BTC = {0:C2}", newPrice); if (newPrice != lastPrice) { lastChange = DateTime.Now; } ChangePrice(ref lastPrice, newPrice); if (timeNow.AddMinutes(10) >= walletUpdatedLast) { updateWallet(); walletUpdatedLast = timeNow; } }