Don't hash mweb addresses

This commit is contained in:
Hector Chu 2024-04-26 09:16:40 +01:00
parent fea7e7a097
commit 66d98a282c

View file

@ -113,11 +113,13 @@ abstract class ElectrumWalletBase
SyncStatus syncStatus;
List<String> get scriptHashes => walletAddresses.addressesByReceiveType
.where((addr) => addressTypeFromStr(addr.address, network) is! MwebAddress)
.map((addr) => scriptHash(addr.address, network: network))
.toList();
List<String> get publicScriptHashes => walletAddresses.allAddresses
.where((addr) => !addr.isHidden)
.where((addr) => addressTypeFromStr(addr.address, network) is! MwebAddress)
.map((addr) => scriptHash(addr.address, network: network))
.toList();
@ -1205,7 +1207,8 @@ abstract class ElectrumWalletBase
}
Future<ElectrumBalance> fetchBalances() async {
final addresses = walletAddresses.allAddresses.toList();
final addresses = walletAddresses.allAddresses.where((address) =>
addressTypeFromStr(address.address, network) is! MwebAddress).toList();
final balanceFutures = <Future<Map<String, dynamic>>>[];
for (var i = 0; i < addresses.length; i++) {
final addressRecord = addresses[i];