Requested changes
Resolves requested changes: removes unnecessary Confirmations field in smartcoin.cs and ensures zero-conf mempool tx's display properly.
MODIFY
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
@@ -27,7 +27,7 @@ namespace WalletWasabi.Gui.Rpc
public object[] GetUnspentCoinList()
{
AssertWalletIsLoaded();
- var tipHeight = ActiveWallet.BitcoinStore.SmartHeaderChain.TipHeight;
+ var serverTipHeight = ActiveWallet.BitcoinStore.SmartHeaderChain.ServerTipHeight;
return ActiveWallet.Coins.Where(x => x.Unspent).Select(x => new
{
txid = x.TransactionId.ToString(),
@@ -35,7 +35,7 @@ namespace WalletWasabi.Gui.Rpc
amount = x.Amount.Satoshi,
anonymitySet = x.AnonymitySet,
confirmed = x.Confirmed,
- confirmations = tipHeight - x.Height + 1,
+ confirmations = x.Confirmed ? serverTipHeight - (uint)x.Height.Value + 1 : 0,
label = x.Label.ToString(),
keyPath = x.HdPubKey.FullKeyPath.ToString(),
address = x.HdPubKey.GetP2wpkhAddress(Global.Network).ToString()

MODIFY
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
@@ -36,7 +36,6 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
private Cluster _clusters;
private bool _confirmed;
- private int _confirmations;
private bool _unavailable;
private bool _unspent;
private bool _isBanned;
@@ -207,12 +206,6 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
private set => RaiseAndSetIfChanged(ref _confirmed, value);
}
- public int Confirmations
- {
- get => _confirmations;
- private set => RaiseAndSetIfChanged(ref _confirmations, value);
- }
-
/// <summary>
/// Spent || SpentAccordingToBackend || CoinJoinInProgress || IsDust;
/// </summary>

Requested changes

Resolves requested changes: removes unnecessary Confirmations field in smartcoin.cs and ensures zero-conf mempool tx's display properly.