tx_construction_helpers: improve RingCT input detection

This commit is contained in:
jeffro256
2025-04-12 14:24:50 -05:00
committed by akildemir
parent ff85622450
commit fec249d598
2 changed files with 4 additions and 3 deletions

View File

@@ -148,7 +148,6 @@ cryptonote::tx_source_entry gen_tx_source_entry_fake_members(
const uint64_t max_global_output_index) const uint64_t max_global_output_index)
{ {
const size_t ring_size = mixin + 1; const size_t ring_size = mixin + 1;
const bool is_rct = in.mask == rct::I;
CHECK_AND_ASSERT_THROW_MES(in.global_output_index <= max_global_output_index, CHECK_AND_ASSERT_THROW_MES(in.global_output_index <= max_global_output_index,
"real global output index too low"); "real global output index too low");
@@ -171,7 +170,7 @@ cryptonote::tx_source_entry gen_tx_source_entry_fake_members(
continue; continue;
used_indices.insert(global_output_index); used_indices.insert(global_output_index);
const rct::ctkey output_pair{rct::pkGen(), const rct::ctkey output_pair{rct::pkGen(),
is_rct ? rct::pkGen() : rct::zeroCommitVartime(in.amount)}; in.is_rct ? rct::pkGen() : rct::zeroCommitVartime(in.amount)};
res.outputs.push_back({global_output_index, output_pair}); res.outputs.push_back({global_output_index, output_pair});
} }
// sort by index // sort by index
@@ -185,11 +184,11 @@ cryptonote::tx_source_entry gen_tx_source_entry_fake_members(
++res.real_output; ++res.real_output;
// copy from in // copy from in
res.rct = in.is_rct;
res.real_out_tx_key = in.real_out_tx_key; res.real_out_tx_key = in.real_out_tx_key;
res.real_out_additional_tx_keys = in.real_out_additional_tx_keys; res.real_out_additional_tx_keys = in.real_out_additional_tx_keys;
res.real_output_in_tx_index = in.local_output_index; res.real_output_in_tx_index = in.local_output_index;
res.amount = in.amount; res.amount = in.amount;
res.rct = is_rct;
res.mask = in.mask; res.mask = in.mask;
return res; return res;
@@ -280,6 +279,7 @@ cryptonote::transaction construct_pre_carrot_tx_with_fake_inputs(
CHECK_AND_ASSERT_THROW_MES(r, "failed to generate balancing input"); CHECK_AND_ASSERT_THROW_MES(r, "failed to generate balancing input");
const stripped_down_tx_source_entry_t balancing_in{ const stripped_down_tx_source_entry_t balancing_in{
.is_rct = rct,
.global_output_index = crypto::rand_range<uint64_t>(0, max_global_output_index), .global_output_index = crypto::rand_range<uint64_t>(0, max_global_output_index),
.onetime_address = input_onetime_address, .onetime_address = input_onetime_address,
.real_out_tx_key = main_tx_keypair.pub, .real_out_tx_key = main_tx_keypair.pub,

View File

@@ -59,6 +59,7 @@ cryptonote::transaction construct_miner_tx_fake_reward_1out(const size_t height,
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
struct stripped_down_tx_source_entry_t struct stripped_down_tx_source_entry_t
{ {
bool is_rct;
uint64_t global_output_index; uint64_t global_output_index;
crypto::public_key onetime_address; crypto::public_key onetime_address;
crypto::public_key real_out_tx_key; crypto::public_key real_out_tx_key;