Remove IsLikelyCoinJoin property, only allow registering confirmed coins.
MODIFY
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
@@ -182,8 +182,7 @@ namespace WalletWasabi.Gui.Rpc
height = x.Height.Value,
amount = x.Amount.Satoshi,
label = x.Label,
- tx = x.TransactionId,
- islikelycoinjoin = x.IsLikelyCoinJoinOutput
+ tx = x.TransactionId
}).ToArray();
}

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionProcessorTests.cs
@@ -693,7 +693,6 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var coin = Assert.Single(transactionProcessor.Coins);
Assert.Equal(4, coin.AnonymitySet);
Assert.Equal(amount, coin.Amount);
- Assert.False(coin.IsLikelyCoinJoinOutput); // It is a coinjoin however we are receiving but not spending.
}
[Fact]
@@ -724,7 +723,6 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var coin = Assert.Single(transactionProcessor.Coins, c => c.AnonymitySet > 1);
Assert.Equal(5, coin.AnonymitySet);
Assert.Equal(amount, coin.Amount);
- Assert.True(coin.IsLikelyCoinJoinOutput); // because we are spending and receiving almost the same amount
}
[Fact]

MODIFY
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
@@ -51,7 +51,6 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
SpentOutputs = Guard.NotNullOrEmpty(nameof(spentOutputs), spentOutputs);
WasReplaceable = replaceable;
AnonymitySet = Guard.InRangeAndNotNull(nameof(anonymitySet), anonymitySet, 1, int.MaxValue);
- IsLikelyCoinJoinOutput = null;
SpenderTransactionId = spenderTransactionId;
@@ -150,8 +149,6 @@ namespace WalletWasabi.Blockchain.TransactionOutputs
public HdPubKey HdPubKey { get; }
- public bool? IsLikelyCoinJoinOutput { get; set; }
-
/// <summary>
/// It's a secret, so it's usually going to be null. Do not use it.
/// This will not get serialized, because that's a security risk.

MODIFY
WalletWasabi/Blockchain/TransactionProcessing/TransactionProcessor.cs
WalletWasabi/Blockchain/TransactionProcessing/TransactionProcessor.cs
@@ -268,12 +268,6 @@ namespace WalletWasabi.Blockchain.TransactionProcessing
}
}
- foreach (var coin in result.ReceivedCoins)
- {
- // May be too late to set it at this point. It'd be better to set at the constructor, but couldn't find a way without ruining performance.
- coin.IsLikelyCoinJoinOutput = result.IsLikelyOwnCoinJoin;
- }
-
if (result.IsNews)
{
TransactionStore.AddOrUpdate(tx);

MODIFY
WalletWasabi/Blockchain/Transactions/TransactionHistoryBuilder.cs
WalletWasabi/Blockchain/Transactions/TransactionHistoryBuilder.cs
@@ -53,8 +53,7 @@ namespace WalletWasabi.Blockchain.Transactions
Amount = coin.Amount,
Label = foundTransaction.Label,
TransactionId = coin.TransactionId,
- BlockIndex = foundTransaction.BlockIndex,
- IsLikelyCoinJoinOutput = coin.IsLikelyCoinJoinOutput is true
+ BlockIndex = foundTransaction.BlockIndex
});
}
@@ -81,8 +80,7 @@ namespace WalletWasabi.Blockchain.Transactions
Amount = Money.Zero - coin.Amount,
Label = foundSpenderTransaction.Label,
TransactionId = coin.SpenderTransactionId,
- BlockIndex = foundSpenderTransaction.BlockIndex,
- IsLikelyCoinJoinOutput = coin.IsLikelyCoinJoinOutput is true
+ BlockIndex = foundSpenderTransaction.BlockIndex
});
}
}

MODIFY
WalletWasabi/Blockchain/Transactions/TransactionSummary.cs
WalletWasabi/Blockchain/Transactions/TransactionSummary.cs
@@ -13,6 +13,5 @@ namespace WalletWasabi.Blockchain.Transactions
public SmartLabel Label { get; set; }
public uint256 TransactionId { get; set; }
public int BlockIndex { get; set; }
- public bool IsLikelyCoinJoinOutput { get; set; }
}
}

MODIFY
WalletWasabi/CoinJoin/Client/Rounds/ClientState.cs
WalletWasabi/CoinJoin/Client/Rounds/ClientState.cs
@@ -178,39 +178,11 @@ namespace WalletWasabi.CoinJoin.Client.Rounds
}
Money amountNeededExceptInputFees = denomination + (feePerOutputs * 2);
- var confirmedResult = GetRegistrableCoinsNoLock(maximumInputCountPerPeer, feePerInputs, amountNeededExceptInputFees, allowUnconfirmedZeroLink: false);
- if (confirmedResult.Any())
- {
- return confirmedResult;
- }
- else
- {
- return GetRegistrableCoinsNoLock(maximumInputCountPerPeer, feePerInputs, amountNeededExceptInputFees, allowUnconfirmedZeroLink: true);
- }
- }
- }
-
- private IEnumerable<OutPoint> GetRegistrableCoinsNoLock(int maximumInputCountPerPeer, Money feePerInputs, Money amountNeededExceptInputFees, bool allowUnconfirmedZeroLink)
- {
- if (!WaitingList.Any()) // To avoid computations.
- {
- return Enumerable.Empty<OutPoint>();
- }
-
- Func<SmartCoin, bool> confirmationPredicate;
- if (allowUnconfirmedZeroLink)
- {
- confirmationPredicate = x => x.Confirmed || x.IsLikelyCoinJoinOutput is true;
- }
- else
- {
- confirmationPredicate = x => x.Confirmed;
- }
var coins = WaitingList
.Where(x => x.Value <= DateTimeOffset.UtcNow)
.Select(x => x.Key) // Only if registering coins is already allowed.
- .Where(confirmationPredicate)
+ .Where(x => x.Confirmed)
.ToList(); // So to not redo it in every cycle.
bool lazyMode = false;
@@ -299,6 +271,7 @@ namespace WalletWasabi.CoinJoin.Client.Rounds
return Enumerable.Empty<OutPoint>(); // Inputs are too small, max input to be registered is reached.
}
+ }
public bool AnyCoinsQueued()
{

Remove IsLikelyCoinJoin property, only allow registering confirmed coins.