From 60b3f223768e1ac956bf639e245783a41f65d0ef Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Mon, 19 May 2025 11:13:01 +0100 Subject: [PATCH] fixed field ordering to allow GCC to compile; removed unlock_time field from CARROT/SPARC TX outputs --- src/carrot_core/carrot_enote_types.h | 6 ++---- src/carrot_core/payment_proposal.cpp | 2 +- src/carrot_impl/format_utils.cpp | 2 +- src/cryptonote_basic/cryptonote_basic.h | 1 - src/wallet/scanning_tools.cpp | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/carrot_core/carrot_enote_types.h b/src/carrot_core/carrot_enote_types.h index 0fa5b92ff..5eb34eb68 100644 --- a/src/carrot_core/carrot_enote_types.h +++ b/src/carrot_core/carrot_enote_types.h @@ -67,16 +67,14 @@ struct CarrotEnoteV1 final encrypted_amount_t amount_enc; /// anchor_enc encrypted_janus_anchor_t anchor_enc; + /// return_enc + encrypted_return_pubkey_t return_enc; /// view_tag view_tag_t view_tag; /// D_e mx25519_pubkey enote_ephemeral_pubkey; /// L_0 crypto::key_image tx_first_key_image; - /// return_enc - encrypted_return_pubkey_t return_enc; - /// asset_type - std::string asset_type; }; /// equality operators diff --git a/src/carrot_core/payment_proposal.cpp b/src/carrot_core/payment_proposal.cpp index 9f620562a..3092a0129 100644 --- a/src/carrot_core/payment_proposal.cpp +++ b/src/carrot_core/payment_proposal.cpp @@ -457,7 +457,7 @@ void get_output_proposal_return_v1(const CarrotPaymentProposalV1 &proposal, output_enote_out.enote.anchor_enc = encrypt_carrot_anchor(proposal.randomness, s_sender_receiver, output_enote_out.enote.onetime_address); // Recalculate the pid_enc = pid XOR m_pid - encrypted_payment_id_out =encrypt_legacy_payment_id(proposal.destination.payment_id, s_sender_receiver, output_enote_out.enote.onetime_address); + encrypted_payment_id_out = encrypt_legacy_payment_id(proposal.destination.payment_id, s_sender_receiver, output_enote_out.enote.onetime_address); // 6. save the amount and first key image output_enote_out.amount = proposal.amount; diff --git a/src/carrot_impl/format_utils.cpp b/src/carrot_impl/format_utils.cpp index 4abe944aa..fe62fed7f 100644 --- a/src/carrot_impl/format_utils.cpp +++ b/src/carrot_impl/format_utils.cpp @@ -379,8 +379,8 @@ cryptonote::transaction store_carrot_to_coinbase_transaction_v1( tx.vout.push_back(cryptonote::tx_out{enote.amount, cryptonote::txout_to_carrot_v1{ .key = enote.onetime_address, - .view_tag = enote.view_tag, .asset_type = enote.asset_type, + .view_tag = enote.view_tag, .encrypted_janus_anchor = enote.anchor_enc } }); diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index 739943242..41d9684bb 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -78,7 +78,6 @@ namespace cryptonote BEGIN_SERIALIZE_OBJECT() FIELD(key) FIELD(asset_type) - VARINT_FIELD(unlock_time) FIELD(view_tag) FIELD(encrypted_janus_anchor) END_SERIALIZE() diff --git a/src/wallet/scanning_tools.cpp b/src/wallet/scanning_tools.cpp index b8c4bd298..ec4c52815 100644 --- a/src/wallet/scanning_tools.cpp +++ b/src/wallet/scanning_tools.cpp @@ -243,8 +243,8 @@ static std::optional view_incoming_scan_pre_car .payment_id = payment_id, .subaddr_index = subaddr_index, .amount = amount, - .asset_type = enote.asset_type, .amount_blinding_factor = amount_blinding_factor, + .asset_type = enote.asset_type, .main_tx_pubkey_index = main_deriv_idx }; }