Skip to content

Commit

Permalink
fix bugs;
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Zhang committed Oct 19, 2016
1 parent 0d1df4f commit ca7a211
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions AntSharesUI/UI/ClaimForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private void button1_Click(object sender, EventArgs e)
}
}
});
this.Close();
}
}
}
7 changes: 6 additions & 1 deletion AntSharesUI/UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private void AddContractToListView(Contract contract, bool selected = false)
private void Blockchain_PersistCompleted(object sender, Block block)
{
persistence_time = DateTime.Now;
CurrentWallet_TransactionsChanged(null, Enumerable.Empty<TransactionInfo>());
}

private void ChangeWallet(UserWallet wallet)
Expand Down Expand Up @@ -135,7 +136,9 @@ private void CurrentWallet_TransactionsChanged(object sender, IEnumerable<Transa
}
foreach (ListViewItem item in listView3.Items)
{
item.SubItems["confirmations"].Text = (Blockchain.Default.Height - ((TransactionInfo)item.Tag).Height + 1)?.ToString() ?? Strings.Unconfirmed;
int? confirmations = (int)Blockchain.Default.Height - (int)((TransactionInfo)item.Tag).Height + 1;
if (confirmations <= 0) confirmations = null;
item.SubItems["confirmations"].Text = confirmations?.ToString() ?? Strings.Unconfirmed;
}
}
}
Expand Down Expand Up @@ -166,6 +169,8 @@ private void timer1_Tick(object sender, EventArgs e)
toolStripProgressBar1.Value = persistence_span.Seconds;
toolStripProgressBar1.Style = ProgressBarStyle.Blocks;
}
if (Program.CurrentWallet?.WalletHeight > Blockchain.Default.Height + 1)
return;
if (balance_changed)
{
IEnumerable<Coin> coins = Program.CurrentWallet?.FindCoins() ?? Enumerable.Empty<Coin>();
Expand Down

0 comments on commit ca7a211

Please sign in to comment.