Integrate GetRawTransactionsAsync to "transaction-hexes" endpoint
MODIFY
WalletWasabi.Backend/Controllers/BlockchainController.cs
WalletWasabi.Backend/Controllers/BlockchainController.cs
@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Backend.Models;
using WalletWasabi.Backend.Models.Responses;
@@ -161,8 +162,7 @@ namespace WalletWasabi.Backend.Controllers
try
{
var hexes = new Dictionary<uint256, string>();
- IRPCClient batchingRpc = RpcClient.PrepareBatch();
- List<Task<Transaction>> tasks = new();
+ List<uint256> missingTxs = new();
lock (TransactionHexCacheLock)
{
foreach (var txid in parsedIds)
@@ -173,16 +173,14 @@ namespace WalletWasabi.Backend.Controllers
}
else
{
- tasks.Add(batchingRpc.GetRawTransactionAsync(txid));
+ missingTxs.Add(txid);
}
}
}
- if (tasks.Any())
+ if (missingTxs.Any())
{
- await batchingRpc.SendBatchAsync();
-
- foreach (var tx in await Task.WhenAll(tasks))
+ foreach (var tx in await RpcClient.GetRawTransactionsAsync(missingTxs, CancellationToken.None))
{
string hex = tx.ToHex();
hexes.Add(tx.GetHash(), hex);

Integrate GetRawTransactionsAsync to "transaction-hexes" endpoint