diff --git a/src/carrot_core/account.h b/src/carrot_core/account.h index 1a0e78deb..07dd72ff9 100644 --- a/src/carrot_core/account.h +++ b/src/carrot_core/account.h @@ -48,6 +48,7 @@ namespace carrot input_context_t input_context; crypto::public_key K_o; // output onetime address crypto::public_key K_change; // change output onetime address + crypto::public_key K_spend_pubkey; // change output spend pubkey crypto::key_image key_image; crypto::secret_key sum_g; crypto::secret_key sender_extension_t; @@ -57,6 +58,7 @@ namespace carrot input_context = input_context_t(); K_o = crypto::public_key(); K_change = crypto::public_key(); + K_spend_pubkey = crypto::public_key(); key_image = crypto::key_image(); sum_g = crypto::secret_key(); sender_extension_t = crypto::secret_key(); @@ -66,12 +68,14 @@ namespace carrot const input_context_t &input_context, const crypto::public_key &K_o, const crypto::public_key &K_change, + const crypto::public_key &K_spend_pubkey, const crypto::key_image &key_image, const crypto::secret_key &sum_g, const crypto::secret_key &sender_extension_t): input_context(input_context), K_o(K_o), K_change(K_change), + K_spend_pubkey(K_spend_pubkey), key_image(key_image), sum_g(sum_g), sender_extension_t(sender_extension_t) {} @@ -80,6 +84,7 @@ namespace carrot FIELD(input_context) FIELD(K_o) FIELD(K_change) + FIELD(K_spend_pubkey) FIELD(key_image) FIELD(sum_g) FIELD(sender_extension_t) @@ -188,6 +193,7 @@ namespace boost x.input_context = carrot::input_context_t(); x.K_o = crypto::public_key(); x.K_change = crypto::public_key(); + x.K_spend_pubkey = crypto::public_key(); x.key_image = crypto::key_image(); x.sum_g = crypto::secret_key(); x.sender_extension_t = crypto::secret_key(); @@ -199,6 +205,7 @@ namespace boost a & x.input_context; a & x.K_o; a & x.K_change; + a & x.K_spend_pubkey; a & x.key_image; a & x.sum_g; a & x.sender_extension_t; diff --git a/src/carrot_core/scan.cpp b/src/carrot_core/scan.cpp index d205cbb67..91936fdae 100644 --- a/src/carrot_core/scan.cpp +++ b/src/carrot_core/scan.cpp @@ -534,7 +534,8 @@ bool try_scan_carrot_enote_internal_receiver(const CarrotEnoteV1 &enote, // HERE BE DRAGONS!!! // SRCG: test whether this will even work for return_payment detection - account.insert_return_output_info({{K_r, {input_context, output_key, enote.onetime_address, key_image, sum_g, sender_extension_t_out}}}); + account.insert_return_output_info({{K_r, {input_context, output_key, enote.onetime_address, address_spend_pubkey_out, key_image, sum_g, sender_extension_t_out}}}); + //account.insert_return_output_info({{K_r, {input_context, output_key, address_spend_pubkey_out, key_image, sum_g, sender_extension_t_out}}}); // LAND AHOY!!! } diff --git a/src/wallet/tx_builder.cpp b/src/wallet/tx_builder.cpp index bfe9e6b8d..a328e4897 100644 --- a/src/wallet/tx_builder.cpp +++ b/src/wallet/tx_builder.cpp @@ -818,13 +818,14 @@ bool get_address_openings_x_y( if (return_output_map.find(rct::rct2pk(src.outputs[src.real_output].second.dest)) != return_output_map.end()) { const auto &return_output = return_output_map.at(rct::rct2pk(src.outputs[src.real_output].second.dest)); - w.get_account().try_searching_for_opening_for_onetime_address( - return_output.K_change, - return_output.sum_g, - return_output.sender_extension_t, - x_out, - y_out - ); + bool r = w.get_account().try_searching_for_opening_for_onetime_address( + return_output.K_spend_pubkey, + return_output.sum_g, + return_output.sender_extension_t, + x_out, + y_out + ); + CHECK_AND_ASSERT_THROW_MES(r, "Failed to obtain openings for onetime address (return_payment)"); return true; }