Make sure NBitcoin updates are utilized.
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -1375,7 +1375,7 @@ namespace WalletWasabi.Tests
await rpc.InvalidateBlockAsync(baseTip);
try
{
- await rpc.SendCommandAsync("abandontransaction", fundingTxid.ToString());
+ await rpc.AbandonTransactionAsync(fundingTxid);
}
catch
{

MODIFY
WalletWasabi/Extensions/RPCClientExtensions.cs
WalletWasabi/Extensions/RPCClientExtensions.cs
@@ -24,7 +24,7 @@ namespace NBitcoin.RPC
/// <returns>Returns the current block on timeout or exit</returns>
public static async Task<(Height height, uint256 hash)> WaitForBlockAsync(this RPCClient rpc, uint256 blockhash, long timeout = 0)
{
- var resp = await rpc.SendCommandAsync("waitforblock", blockhash.ToString(), timeout);
+ var resp = await rpc.SendCommandAsync("waitforblock", blockhash, timeout);
return (int.Parse(resp.Result["height"].ToString()), uint256.Parse(resp.Result["hash"].ToString()));
}

MODIFY
WalletWasabi/Services/CcjCoordinator.cs
WalletWasabi/Services/CcjCoordinator.cs
@@ -80,9 +80,9 @@ namespace WalletWasabi.Services
try
{
uint256 txHash = new uint256(line);
- RPCResponse getRawTransactionResponse = RpcClient.SendCommand(RPCOperations.getrawtransaction, txHash.ToString(), true);
+ RawTransactionInfo rawTransactionInfo = RpcClient.GetRawTransactionInfo(txHash);
CoinJoins.Add(txHash);
- if (getRawTransactionResponse.Result.Value<int>("confirmations") <= 0)
+ if (rawTransactionInfo.Confirmations == 0)
{
UnconfirmedCoinJoins.Add(txHash);
}
@@ -296,18 +296,23 @@ namespace WalletWasabi.Services
{
foreach (var cjHash in UnconfirmedCoinJoins)
{
- RPCResponse getRawTransactionResponse = await RpcClient.SendCommandAsync(RPCOperations.getrawtransaction, cjHash.ToString(), true);
- // if failed remove from everywhere (should not happen normally)
- if (string.IsNullOrWhiteSpace(getRawTransactionResponse?.ResultString))
+ try
+ {
+ RawTransactionInfo rawTransactionInfo = await RpcClient.GetRawTransactionInfoAsync(cjHash);
+
+ // if confirmed remove only from unconfirmed
+ if (rawTransactionInfo.Confirmations > 0)
{
UnconfirmedCoinJoins.Remove(cjHash);
- CoinJoins.Remove(cjHash);
- await File.WriteAllLinesAsync(CoinJoinsFilePath, CoinJoins.Select(x => x.ToString()));
}
- // if confirmed remove only from unconfirmed
- if (getRawTransactionResponse.Result.Value<int>("confirmations") > 0)
+ }
+ catch (Exception ex)
{
+ // if failed remove from everywhere (should not happen normally)
UnconfirmedCoinJoins.Remove(cjHash);
+ CoinJoins.Remove(cjHash);
+ await File.WriteAllLinesAsync(CoinJoinsFilePath, CoinJoins.Select(x => x.ToString()));
+ Logger.LogWarning<CcjCoordinator>(ex);
}
}
}

Make sure NBitcoin updates are utilized.