This commit is contained in:
Rafael Saes 2024-03-05 09:45:19 -03:00
parent 2db156ef16
commit d4461b1c55
6 changed files with 24 additions and 15 deletions

View file

@ -1196,7 +1196,7 @@ Future<void> startRefresh(ScanData scanData) async {
for (var i = 0; i < tweaks!.length; i++) {
try {
final details = tweaks[i] as Map<String, dynamic>;
final output_pubkeys = (details["output_pubkeys"] as List<dynamic>);
final outputPubkeys = (details["output_pubkeys"] as List<dynamic>);
final tweak = details["tweak"].toString();
// TODO: if tx already scanned & stored skip
@ -1210,12 +1210,13 @@ Future<void> 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<void> startRefresh(ScanData scanData) async {
try {
final addressRecord = BitcoinSilentPaymentAddressRecord(address,
index: 0,
isHidden: true,
isHidden: false,
isUsed: true,
network: scanData.network,
silentPaymentTweak: t_k);

View file

@ -244,11 +244,13 @@ 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;
}

View file

@ -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"

View file

@ -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

View file

@ -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

12
testing Normal file
View file

@ -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]