From d4461b1c55c37802292c3fc8544d4a65db79cf84 Mon Sep 17 00:00:00 2001 From: Rafael Saes Date: Tue, 5 Mar 2024 09:45:19 -0300 Subject: [PATCH] temp --- cw_bitcoin/lib/electrum_wallet.dart | 7 ++++--- cw_bitcoin/lib/electrum_wallet_addresses.dart | 4 +++- cw_bitcoin/pubspec.lock | 8 +++----- cw_bitcoin/pubspec.yaml | 4 +--- cw_bitcoin_cash/pubspec.yaml | 4 +--- testing | 12 ++++++++++++ 6 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 testing diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index 8d68f6c8f..d0caa560d 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -1196,7 +1196,7 @@ Future startRefresh(ScanData scanData) async { for (var i = 0; i < tweaks!.length; i++) { try { final details = tweaks[i] as Map; - final output_pubkeys = (details["output_pubkeys"] as List); + final outputPubkeys = (details["output_pubkeys"] as List); final tweak = details["tweak"].toString(); // TODO: if tx already scanned & stored skip @@ -1210,12 +1210,13 @@ Future startRefresh(ScanData scanData) async { final result = spb.scanOutputs( scanData.silentAddress.b_scan, scanData.silentAddress.B_spend, - output_pubkeys + outputPubkeys .map((output) => BytesUtils.toHexString(BytesUtils.fromHexString(output.toString()).sublist(2)) .toString()) .toList(), precomputedLabels: scanData.labels, + log: tweak == "02967d38989b20e99e5ea26a9b58837489438c69cb0caef41a47160102c72fcabd", ); if (result.isEmpty) { @@ -1235,7 +1236,7 @@ Future startRefresh(ScanData scanData) async { try { final addressRecord = BitcoinSilentPaymentAddressRecord(address, index: 0, - isHidden: true, + isHidden: false, isUsed: true, network: scanData.network, silentPaymentTweak: t_k); diff --git a/cw_bitcoin/lib/electrum_wallet_addresses.dart b/cw_bitcoin/lib/electrum_wallet_addresses.dart index 5a839e3a5..cddb8f1f3 100644 --- a/cw_bitcoin/lib/electrum_wallet_addresses.dart +++ b/cw_bitcoin/lib/electrum_wallet_addresses.dart @@ -244,10 +244,12 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store { final silentAddressRecord = silentAddresses[i]; final silentPaymentTweak = silentAddressRecord.silentPaymentTweak; - if (silentPaymentTweak != null) + if (silentPaymentTweak != null && + SilentPaymentAddress.regex.hasMatch(silentAddressRecord.address)) { labels[G .tweakMul(BigintUtils.fromBytes(BytesUtils.fromHexString(silentPaymentTweak))) .toHex()] = silentPaymentTweak; + } } return labels; } diff --git a/cw_bitcoin/pubspec.lock b/cw_bitcoin/pubspec.lock index 91af2d807..cae1a0c9a 100644 --- a/cw_bitcoin/pubspec.lock +++ b/cw_bitcoin/pubspec.lock @@ -78,11 +78,9 @@ packages: bitcoin_base: dependency: "direct main" description: - path: "." - ref: cake-update-v2 - resolved-ref: f45e34d18ddff52764101a2ec96dcbc2be730555 - url: "https://github.com/cake-tech/bitcoin_base" - source: git + path: "/home/rafael/Working/bitcoin_base" + relative: false + source: path version: "4.0.0" bitcoin_flutter: dependency: "direct main" diff --git a/cw_bitcoin/pubspec.yaml b/cw_bitcoin/pubspec.yaml index f6ee88e29..eea3e7264 100644 --- a/cw_bitcoin/pubspec.yaml +++ b/cw_bitcoin/pubspec.yaml @@ -31,9 +31,7 @@ dependencies: unorm_dart: ^0.2.0 cryptography: ^2.0.5 bitcoin_base: - git: - url: https://github.com/cake-tech/bitcoin_base - ref: cake-update-v2 + path: /home/rafael/Working/bitcoin_base blockchain_utils: git: url: https://github.com/cake-tech/blockchain_utils diff --git a/cw_bitcoin_cash/pubspec.yaml b/cw_bitcoin_cash/pubspec.yaml index 4d500f048..2ba84d630 100644 --- a/cw_bitcoin_cash/pubspec.yaml +++ b/cw_bitcoin_cash/pubspec.yaml @@ -30,9 +30,7 @@ dependencies: url: https://github.com/cake-tech/bitbox-flutter.git ref: master bitcoin_base: - git: - url: https://github.com/cake-tech/bitcoin_base - ref: cake-update-v2 + path: /home/rafael/Working/bitcoin_base blockchain_utils: git: url: https://github.com/cake-tech/blockchain_utils diff --git a/testing b/testing new file mode 100644 index 000000000..10453ff5b --- /dev/null +++ b/testing @@ -0,0 +1,12 @@ +2580492 + +I/flutter ( 8735): [senderPartialSecret, c21f575962fe92b961a6a06d5772764336e03d6158e572dd35451b67fd5e9df1] +I/flutter ( 8735): [ecdhSharedSecret, 022cb8d299a83b125a910aa1ed8c51708ad3a1294c03e2e57f8944350c36a248d3] + +I/flutter ( 8735): [senderPartialSecret, 02967d38989b20e99e5ea26a9b58837489438c69cb0caef41a47160102c72fcabd] +I/flutter ( 8735): [ecdhSharedSecret, 022cb8d299a83b125a910aa1ed8c51708ad3a1294c03e2e57f8944350c36a248d3] + +I/flutter ( 8735): [output, 029111cfc2576d54cd215b8e629c736bce94cbdf4aa5f7f4924ca3b77fad124d74, P_k, 024eca364bcfd2f89e03ad7be912d943a5abbbb1f46d57575cc43b9cd05b47ee95, m_G_sub, 03636d1de76382fd0909833b27d60712939984acd190d686d8a718202a9739f27b, {028b107ddd915f8ff23a131207248b9ab136ba5ec6ae0562065d302859a009f813: 14c9c51ecea4a956655b776a20c31915b5ba02933db99c1ba2302f5ba5462aba}] +I/flutter ( 8735): [output, 029111cfc2576d54cd215b8e629c736bce94cbdf4aa5f7f4924ca3b77fad124d74, P_k, 024eca364bcfd2f89e03ad7be912d943a5abbbb1f46d57575cc43b9cd05b47ee95, m_G_sub, 03636d1de76382fd0909833b27d60712939984acd190d686d8a718202a9739f27b, {028b107ddd915f8ff23a131207248b9ab136ba5ec6ae0562065d302859a009f813: 14c9c51ecea4a956655b776a20c31915b5ba02933db99c1ba2302f5ba5462aba}, 02cbe12b5f09477e3dec658e99226c79bc9cedb9b619885944dd68f4c2dd7f0f47] +I/flutter ( 8735): [output, 029111cfc2576d54cd215b8e629c736bce94cbdf4aa5f7f4924ca3b77fad124d74, P_k, 024eca364bcfd2f89e03ad7be912d943a5abbbb1f46d57575cc43b9cd05b47ee95, m_G_sub, 03636d1de76382fd0909833b27d60712939984acd190d686d8a718202a9739f27b, {028b107ddd915f8ff23a131207248b9ab136ba5ec6ae0562065d302859a009f813: 14c9c51ecea4a956655b776a20c31915b5ba02933db99c1ba2302f5ba5462aba}, 51209111cfc2576d54cd215b8e629c736bce94cbdf4aa5f7f4924ca3b77fad124d74, 512014b2c03fedfdf0dd1e7db256cf8b2b3254031e85fbafd77f6a04396615896832] +