mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
fix inconsistent result of labels in greenfield compared to ui wallets tx list
This commit is contained in:
parent
5b7b217b9c
commit
e5c7fc93e2
1 changed files with 9 additions and 2 deletions
|
@ -307,11 +307,18 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
|
|
||||||
var walletId = new WalletId(storeId, cryptoCode);
|
var walletId = new WalletId(storeId, cryptoCode);
|
||||||
var utxos = await wallet.GetUnspentCoins(derivationScheme.AccountDerivation);
|
var utxos = await wallet.GetUnspentCoins(derivationScheme.AccountDerivation);
|
||||||
var walletTransactionsInfoAsync = await _walletRepository.GetWalletTransactionsInfo(walletId,
|
var walletTransactionsInfoAsync = await _walletRepository.GetWalletTransactionsInfo(walletId,
|
||||||
utxos.Select(u => u.OutPoint.Hash.ToString()).ToHashSet().ToArray());
|
utxos.SelectMany(GetWalletObjectsQuery.Get).Distinct().ToArray());
|
||||||
return Ok(utxos.Select(coin =>
|
return Ok(utxos.Select(coin =>
|
||||||
{
|
{
|
||||||
walletTransactionsInfoAsync.TryGetValue(coin.OutPoint.Hash.ToString(), out var info);
|
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()
|
return new OnChainWalletUTXOData()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue