Skip to content

Commit 7607d3c

Browse files
committed
Squashed 'src/secp256k1/' changes from 3d08027789..0270b14309
0270b14309 labels: actually set the label git-subtree-dir: src/secp256k1 git-subtree-split: 0270b1430981584582645161a04a4df67cd187bb
1 parent 785ef3d commit 7607d3c

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/modules/silentpayments/main_impl.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,10 @@ int secp256k1_silentpayments_recipient_scan_outputs(
494494
found = 0;
495495
for (i = 0; i < n_tx_outputs; i++) {
496496
if (secp256k1_xonly_pubkey_cmp(ctx, &P_output_xonly, tx_outputs[i]) == 0) {
497-
found_outputs[n_found]->output = *tx_outputs[i];
497+
secp256k1_xonly_pubkey_save(&found_outputs[n_found]->output, &P_output_ge);
498498
secp256k1_scalar_get_b32(found_outputs[n_found]->tweak, &t_k_scalar);
499+
found_outputs[n_found]->found_with_label = 0;
500+
secp256k1_pubkey_save(&found_outputs[n_found]->label, &P_output_ge);
499501
found = 1;
500502
n_found++;
501503
k++;
@@ -522,9 +524,9 @@ int secp256k1_silentpayments_recipient_scan_outputs(
522524

523525
label_tweak = label_lookup(&label_pubkey, label_context);
524526
if (label_tweak != NULL) {
525-
found_outputs[n_found]->output = *tx_outputs[i];
527+
secp256k1_xonly_pubkey_save(&found_outputs[n_found]->output, &tx_output_ge);
526528
found_outputs[n_found]->found_with_label = 1;
527-
found_outputs[n_found]->label = label_pubkey;
529+
secp256k1_pubkey_save(&found_outputs[n_found]->label, &label_ge);
528530
secp256k1_scalar_get_b32(found_outputs[n_found]->tweak, &t_k_scalar);
529531
if (!secp256k1_ec_seckey_tweak_add(ctx, found_outputs[n_found]->tweak, label_tweak)) {
530532
return 0;
@@ -544,9 +546,9 @@ int secp256k1_silentpayments_recipient_scan_outputs(
544546

545547
label_tweak = label_lookup(&label_pubkey, label_context);
546548
if (label_tweak != NULL) {
547-
found_outputs[n_found]->output = *tx_outputs[i];
549+
secp256k1_xonly_pubkey_save(&found_outputs[n_found]->output, &tx_output_ge);
548550
found_outputs[n_found]->found_with_label = 1;
549-
found_outputs[n_found]->label = label_pubkey;
551+
secp256k1_pubkey_save(&found_outputs[n_found]->label, &label_ge);
550552
secp256k1_scalar_get_b32(found_outputs[n_found]->tweak, &t_k_scalar);
551553
if (!secp256k1_ec_seckey_tweak_add(ctx, found_outputs[n_found]->tweak, label_tweak)) {
552554
return 0;

src/modules/silentpayments/tests_impl.h

-4
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,8 @@ void run_silentpayments_test_vector_receive(const struct bip352_test_vector *tes
212212
* For this example, we'll just iterate through the list of pubkeys */
213213
found = 0;
214214
secp256k1_xonly_pubkey_serialize(CTX, xonly_print, &potential_output);
215-
printf("what we generated :");
216-
print_hex(xonly_print, 32);
217215
for (i = 0; i < test->num_to_scan_outputs; i++) {
218216
secp256k1_xonly_pubkey_serialize(CTX, xonly_print, tx_outputs[i]);
219-
printf("what is in the tx :");
220-
print_hex(xonly_print, 32);
221217
if (secp256k1_xonly_pubkey_cmp(CTX, &potential_output, tx_outputs[i]) == 0) {
222218
secp256k1_xonly_pubkey_serialize(CTX, found_outputs_light_client[n_found], &potential_output);
223219
found = 1;

0 commit comments

Comments
 (0)