mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
fix inconsistent result of labels in greenfield compared to ui wallets tx list
This commit is contained in:
@@ -307,11 +307,18 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
|
||||
var walletId = new WalletId(storeId, cryptoCode);
|
||||
var utxos = await wallet.GetUnspentCoins(derivationScheme.AccountDerivation);
|
||||
var walletTransactionsInfoAsync = await _walletRepository.GetWalletTransactionsInfo(walletId,
|
||||
utxos.Select(u => u.OutPoint.Hash.ToString()).ToHashSet().ToArray());
|
||||
var walletTransactionsInfoAsync = await _walletRepository.GetWalletTransactionsInfo(walletId,
|
||||
utxos.SelectMany(GetWalletObjectsQuery.Get).Distinct().ToArray());
|
||||
return Ok(utxos.Select(coin =>
|
||||
{
|
||||
walletTransactionsInfoAsync.TryGetValue(coin.OutPoint.Hash.ToString(), out var info);
|
||||
walletTransactionsInfoAsync.TryGetValue(coin.ScriptPubKey.ToHex(), out var info2);
|
||||
|
||||
if (info is not null && info2 is not null)
|
||||
{
|
||||
info.Merge(info2);
|
||||
}
|
||||
info ??= info2;
|
||||
|
||||
return new OnChainWalletUTXOData()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user