Skip to content

Commit 55de7d2

Browse files
authored
Added the Bech32Address to GetAddressBalance() (#216)
The GetAddressBalance() method does not return any results when using a segwit address. This change fixes this.
1 parent 91940e2 commit 55de7d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Features/Blockcore.Features.Wallet/WalletManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ public AddressBalance GetAddressBalance(string address)
856856

857857
foreach (Types.Wallet wallet in this.Wallets)
858858
{
859-
hdAddress = wallet.GetAllAddresses().FirstOrDefault(a => a.Address == address);
859+
hdAddress = wallet.GetAllAddresses().FirstOrDefault(a => a.Address == address || a.Bech32Address == address);
860860
if (hdAddress == null) continue;
861861

862862
// When this query to get balance on specific address, we will exclude the cold staking UTXOs.
@@ -2067,4 +2067,4 @@ public ExtKey GetExtKey(WalletAccountReference accountReference, string password
20672067
return new ExtKey(privateKey, wallet.ChainCode);
20682068
}
20692069
}
2070-
}
2070+
}

0 commit comments

Comments
 (0)