remove control statements from middle of a method
MODIFY
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
@@ -1212,10 +1212,8 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
// If we can build a transaction that the mempool accepts, then we're good, no need to remove any Alices.
(bool accept, string rejectReason) resultAll = await TestMempoolAcceptWithTransactionSimulationAsync().ConfigureAwait(false);
- if (resultAll.accept)
+ if (!resultAll.accept)
{
- return;
- }
Logger.LogInfo($"Round ({RoundId}): Mempool acceptance is unsuccessful! Number of Alices: {Alices.Count}.");
// The created tx was not accepted. Let's figure out why. Is it because an Alice doublespent or because of too long mempool chains.
@@ -1244,17 +1242,20 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
// If we removed spent Alices, then test mempool acceptance again.
// If we did not remove spent Alices, then no need to test again, we know it's because of unconfirmed Alices.
+ var problemSolved = false;
if (alicesSpent.Any())
{
// Let's test another fake transaction, maybe the problem was spent inputs.
resultAll = await TestMempoolAcceptWithTransactionSimulationAsync().ConfigureAwait(false);
if (resultAll.accept)
{
- return;
+ problemSolved = true;
}
Logger.LogInfo($"Round ({RoundId}): Mempool acceptance is unsuccessful! Number of Alices: {Alices.Count}.");
}
+ if (!problemSolved)
+ {
// Let's go remove the unconfirmed Alices.
// If there are unconfirmed Alices those are also spent Alices, then we don't need to double remove them.
foreach (var alice in alicesUnconfirmed.Except(alicesSpent))
@@ -1264,6 +1265,8 @@ namespace WalletWasabi.CoinJoin.Coordinator.Rounds
}
}
}
+ }
+ }
private async Task<List<(Alice alice, GetTxOutResponse resp)>> GetTxOutForAllInputsAsync()
{

remove control statements from middle of a method