Fix GetSingleOrDefaultRound null warnings
MODIFY
WalletWasabi/CoinJoin/Client/Clients/CoinJoinClient.cs
WalletWasabi/CoinJoin/Client/Clients/CoinJoinClient.cs
@@ -218,10 +218,13 @@ namespace WalletWasabi.CoinJoin.Client.Clients
// First, if there's delayed round registration update based on the state.
if (DelayedRoundRegistration is { })
{
- ClientRound roundRegistered = State.GetSingleOrDefaultRound(DelayedRoundRegistration.AliceClient.RoundId);
+ ClientRound? roundRegistered = State.GetSingleOrDefaultRound(DelayedRoundRegistration.AliceClient.RoundId);
+ if (roundRegistered is { })
+ {
roundRegistered.Registration = DelayedRoundRegistration;
DelayedRoundRegistration = null; // Do not dispose.
}
+ }
await DequeueSpentCoinsFromMixNoLockAsync().ConfigureAwait(false);
@@ -578,7 +581,7 @@ namespace WalletWasabi.CoinJoin.Client.Clients
var registration = new ClientRoundRegistration(aliceClient, coinsRegistered, outputAddresses.change.GetP2wpkhAddress(Network));
- ClientRound roundRegistered = State.GetSingleOrDefaultRound(aliceClient.RoundId);
+ ClientRound? roundRegistered = State.GetSingleOrDefaultRound(aliceClient.RoundId);
if (roundRegistered is null)
{
// If our SatoshiClient does not yet know about the round, because of delay, then delay the round registration.

MODIFY
WalletWasabi/CoinJoin/Client/Rounds/ClientState.cs
WalletWasabi/CoinJoin/Client/Rounds/ClientState.cs
@@ -349,7 +349,7 @@ namespace WalletWasabi.CoinJoin.Client.Rounds
}
}
- public ClientRound GetSingleOrDefaultRound(long roundId)
+ public ClientRound? GetSingleOrDefaultRound(long roundId)
{
lock (StateLock)
{

Fix GetSingleOrDefaultRound null warnings