Invert if (so it'll be closer to how we used in the original code.)
MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -1005,17 +1005,17 @@ namespace WalletWasabi.Services
}
HdPubKey changeHdPubKey = null;
- if (customChange != null)
- {
- builder.SetChange(customChange);
- }
- else
+ if (customChange is null)
{
KeyManager.AssertCleanKeysIndexed(isInternal: true);
KeyManager.AssertLockedInternalKeysIndexed(14);
changeHdPubKey = KeyManager.GetKeys(KeyState.Clean, true).RandomElement();
builder.SetChange(changeHdPubKey.P2wpkhScript);
}
+ else
+ {
+ builder.SetChange(customChange);
+ }
builder.SendEstimatedFees(feePerBytes);
var psbt = builder.BuildPSBT(false);

Invert if (so it'll be closer to how we used in the original code.)