3434// local headers
3535#include " common/container_helpers.h"
3636#include " ringct/rctOps.h"
37+ #include " ringct/rctSigs.h"
3738#include " tx_construction_helpers.h"
3839
3940#undef MONERO_DEFAULT_LOG_CATEGORY
@@ -303,18 +304,14 @@ void fake_pruned_blockchain::add_block(cryptonote::block &&blk,
303304 parsed_block_with_unlocked_miner_tx.block .miner_tx ;
304305 for (size_t local_output_index = 0 ; local_output_index < unlocked_miner_tx.vout .size (); ++local_output_index)
305306 {
306- const cryptonote::tx_out &o = unlocked_miner_tx.vout .at (local_output_index);
307- crypto::public_key output_pubkey;
308- CHECK_AND_ASSERT_THROW_MES (cryptonote::get_output_public_key (o, output_pubkey),
309- " cannot get output pubkey" );
310- const rct::key amount_commitment = rct::zeroCommitVartime (o.amount );
311- const fcmp_pp::curve_trees::OutputPair output_pair{output_pubkey, amount_commitment};
307+ const rct::ctkey ctkey = rct::getCtKey (unlocked_miner_tx, local_output_index);
308+ const fcmp_pp::curve_trees::OutputPair output_pair{rct::rct2pk (ctkey.dest ), ctkey.mask };
312309 if (!is_valid_output_pair_for_tree (output_pair))
313310 continue ;
314311 const uint64_t global_output_index =
315312 parsed_block_with_unlocked_miner_tx.o_indices .indices .at (0 ).indices .at (local_output_index);
316313 new_spendable_outputs.push_back (fcmp_pp::curve_trees::OutputContext{
317- global_output_index, output_pair
314+ global_output_index, false /* torsion_checked */ , output_pair
318315 });
319316 }
320317 }
@@ -326,19 +323,14 @@ void fake_pruned_blockchain::add_block(cryptonote::block &&blk,
326323 const cryptonote::transaction &unlocked_tx = parsed_block_with_unlocked_txs.txes .at (tx_index);
327324 for (size_t local_output_index = 0 ; local_output_index < unlocked_tx.vout .size (); ++local_output_index)
328325 {
329- const cryptonote::tx_out &o = unlocked_tx.vout .at (local_output_index);
330- crypto::public_key output_pubkey;
331- CHECK_AND_ASSERT_THROW_MES (cryptonote::get_output_public_key (o, output_pubkey),
332- " cannot get output pubkey" );
333- const rct::key amount_commitment = o.amount
334- ? rct::zeroCommitVartime (o.amount ) : unlocked_tx.rct_signatures .outPk .at (local_output_index).mask ;
335- const fcmp_pp::curve_trees::OutputPair output_pair{output_pubkey, amount_commitment};
326+ const rct::ctkey ctkey = rct::getCtKey (unlocked_tx, local_output_index);
327+ const fcmp_pp::curve_trees::OutputPair output_pair{rct::rct2pk (ctkey.dest ), ctkey.mask };
336328 if (!is_valid_output_pair_for_tree (output_pair))
337329 continue ;
338330 const uint64_t global_output_index =
339331 parsed_block_with_unlocked_txs.o_indices .indices .at (tx_index + 1 ).indices .at (local_output_index);
340332 new_spendable_outputs.push_back (fcmp_pp::curve_trees::OutputContext{
341- global_output_index, output_pair
333+ global_output_index, false /* torsion_checked */ , output_pair
342334 });
343335 }
344336 }
0 commit comments