mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
search for btc recipient address in wallet addresses (#3154)
This commit is contained in:
@@ -838,11 +838,18 @@ class CWBitcoin extends Bitcoin {
|
|||||||
final bitcoinWallet = wallet as BitcoinWallet;
|
final bitcoinWallet = wallet as BitcoinWallet;
|
||||||
final bitcoinTx = tx as ElectrumTransactionInfo;
|
final bitcoinTx = tx as ElectrumTransactionInfo;
|
||||||
|
|
||||||
|
final addresses = <String>[];
|
||||||
|
|
||||||
if (bitcoinTx.unspents == null || bitcoinTx.unspents!.isEmpty) {
|
if (bitcoinTx.unspents == null || bitcoinTx.unspents!.isEmpty) {
|
||||||
return null;
|
if(bitcoinTx.outputAddresses == null) return null;
|
||||||
|
for(final addr in bitcoinTx.outputAddresses!) {
|
||||||
|
if(bitcoinWallet.walletAddresses.allAddresses.firstWhereOrNull((item)=>item.address==addr) != null) {
|
||||||
|
addresses.add(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
final addresses = <String>[];
|
|
||||||
final labels = <String>[];
|
final labels = <String>[];
|
||||||
try {
|
try {
|
||||||
bitcoinTx.unspents!.forEach((unspent) {
|
bitcoinTx.unspents!.forEach((unspent) {
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ import 'package:bitbox_flutter/bitbox_flutter.dart' as bitbox;
|
|||||||
import 'package:trezor_connect/trezor_connect.dart' as trezor;
|
import 'package:trezor_connect/trezor_connect.dart' as trezor;
|
||||||
import 'package:blockchain_utils/blockchain_utils.dart';
|
import 'package:blockchain_utils/blockchain_utils.dart';
|
||||||
import 'package:bip39/bip39.dart' as bip39;
|
import 'package:bip39/bip39.dart' as bip39;
|
||||||
|
import 'package:collection/collection.dart';
|
||||||
""";
|
""";
|
||||||
const bitcoinCWHeaders = """
|
const bitcoinCWHeaders = """
|
||||||
import 'package:cw_bitcoin/utils.dart';
|
import 'package:cw_bitcoin/utils.dart';
|
||||||
|
|||||||
Reference in New Issue
Block a user