Skip to content

Commit 0a9b20c

Browse files
committed
1 parent 709f946 commit 0a9b20c

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed

src/wallet/tx_builder.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ static carrot::InputCandidate make_input_candidate(const wallet2_basic::transfer
246246
}
247247
//-------------------------------------------------------------------------------------------------------------------
248248
//-------------------------------------------------------------------------------------------------------------------
249-
std::vector<cryptonote::tx_destination_entry> finalized_destinations_ref(const tx_reconstruct_variant_t &v,
249+
std::vector<cryptonote::tx_destination_entry> finalized_destinations(const tx_reconstruct_variant_t &v,
250250
const carrot::view_incoming_key_device &k_view_dev)
251251
{
252-
struct finalized_destinations_ref_visitor
252+
struct finalized_destinations_visitor
253253
{
254254
std::vector<cryptonote::tx_destination_entry> operator()(const PreCarrotTransactionProposal &p) const
255255
{
@@ -269,13 +269,13 @@ std::vector<cryptonote::tx_destination_entry> finalized_destinations_ref(const t
269269

270270
const carrot::view_incoming_key_device &k_view_dev;
271271
};
272-
return std::visit(finalized_destinations_ref_visitor{k_view_dev}, v);
272+
return std::visit(finalized_destinations_visitor{k_view_dev}, v);
273273
}
274274
//-------------------------------------------------------------------------------------------------------------------
275-
cryptonote::tx_destination_entry change_destination_ref(const tx_reconstruct_variant_t &v,
275+
cryptonote::tx_destination_entry change_destination(const tx_reconstruct_variant_t &v,
276276
const carrot::view_incoming_key_device &k_view_dev)
277277
{
278-
struct change_destination_ref_visitor
278+
struct change_destination_visitor
279279
{
280280
cryptonote::tx_destination_entry operator()(const PreCarrotTransactionProposal &p) const
281281
{
@@ -290,12 +290,12 @@ cryptonote::tx_destination_entry change_destination_ref(const tx_reconstruct_var
290290

291291
const carrot::view_incoming_key_device &k_view_dev;
292292
};
293-
return std::visit(change_destination_ref_visitor{k_view_dev}, v);
293+
return std::visit(change_destination_visitor{k_view_dev}, v);
294294
}
295295
//-------------------------------------------------------------------------------------------------------------------
296-
rct::xmr_amount fee_ref(const tx_reconstruct_variant_t &v)
296+
rct::xmr_amount fee(const tx_reconstruct_variant_t &v)
297297
{
298-
struct fee_ref_visitor
298+
struct fee_visitor
299299
{
300300
rct::xmr_amount operator()(const PreCarrotTransactionProposal &p) const
301301
{
@@ -310,12 +310,12 @@ rct::xmr_amount fee_ref(const tx_reconstruct_variant_t &v)
310310
return p.fee;
311311
}
312312
};
313-
return std::visit(fee_ref_visitor{}, v);
313+
return std::visit(fee_visitor{}, v);
314314
}
315315
//-------------------------------------------------------------------------------------------------------------------
316-
std::optional<crypto::hash8> short_payment_id_ref(const tx_reconstruct_variant_t &v)
316+
std::optional<crypto::hash8> short_payment_id(const tx_reconstruct_variant_t &v)
317317
{
318-
struct short_payment_id_ref_visitor
318+
struct short_payment_id_visitor
319319
{
320320
std::optional<crypto::hash8> operator()(const PreCarrotTransactionProposal &p) const
321321
{
@@ -339,10 +339,10 @@ std::optional<crypto::hash8> short_payment_id_ref(const tx_reconstruct_variant_t
339339
return std::nullopt;
340340
}
341341
};
342-
return std::visit(short_payment_id_ref_visitor{}, v);
342+
return std::visit(short_payment_id_visitor{}, v);
343343
}
344344
//-------------------------------------------------------------------------------------------------------------------
345-
std::optional<crypto::hash> long_payment_id_ref(const tx_reconstruct_variant_t &v)
345+
std::optional<crypto::hash> long_payment_id(const tx_reconstruct_variant_t &v)
346346
{
347347
const PreCarrotTransactionProposal *p = std::get_if<PreCarrotTransactionProposal>(&v);
348348
if (nullptr == p)
@@ -359,9 +359,9 @@ std::optional<crypto::hash> long_payment_id_ref(const tx_reconstruct_variant_t &
359359
return pid32;
360360
}
361361
//-------------------------------------------------------------------------------------------------------------------
362-
std::vector<crypto::public_key> spent_onetime_addresses_ref(const tx_reconstruct_variant_t &v)
362+
std::vector<crypto::public_key> spent_onetime_addresses(const tx_reconstruct_variant_t &v)
363363
{
364-
struct spent_onetime_addresses_ref_visitor
364+
struct spent_onetime_addresses_visitor
365365
{
366366
std::vector<crypto::public_key> operator()(const PreCarrotTransactionProposal &tcd) const
367367
{
@@ -382,12 +382,12 @@ std::vector<crypto::public_key> spent_onetime_addresses_ref(const tx_reconstruct
382382
}
383383
};
384384

385-
return std::visit(spent_onetime_addresses_ref_visitor{}, v);
385+
return std::visit(spent_onetime_addresses_visitor{}, v);
386386
}
387387
//-------------------------------------------------------------------------------------------------------------------
388-
boost::multiprecision::uint128_t input_amount_total_ref(const tx_reconstruct_variant_t &v)
388+
boost::multiprecision::uint128_t input_amount_total(const tx_reconstruct_variant_t &v)
389389
{
390-
struct input_amount_total_ref_visitor
390+
struct input_amount_total_visitor
391391
{
392392
boost::multiprecision::uint128_t operator()(const PreCarrotTransactionProposal &p) const
393393
{
@@ -407,12 +407,12 @@ boost::multiprecision::uint128_t input_amount_total_ref(const tx_reconstruct_var
407407
return res;
408408
}
409409
};
410-
return std::visit(input_amount_total_ref_visitor{}, v);
410+
return std::visit(input_amount_total_visitor{}, v);
411411
}
412412
//-------------------------------------------------------------------------------------------------------------------
413-
std::vector<std::uint64_t> ring_sizes_ref(const tx_reconstruct_variant_t &v)
413+
std::vector<std::uint64_t> ring_sizes(const tx_reconstruct_variant_t &v)
414414
{
415-
struct ring_sizes_ref_visitor
415+
struct ring_sizes_visitor
416416
{
417417
std::vector<std::uint64_t> operator()(const PreCarrotTransactionProposal &p) const
418418
{
@@ -428,10 +428,10 @@ std::vector<std::uint64_t> ring_sizes_ref(const tx_reconstruct_variant_t &v)
428428
return std::vector<std::uint64_t>(p.input_proposals.size());
429429
}
430430
};
431-
return std::visit(ring_sizes_ref_visitor{}, v);
431+
return std::visit(ring_sizes_visitor{}, v);
432432
}
433433
//-------------------------------------------------------------------------------------------------------------------
434-
std::uint64_t unlock_time_ref(const tx_reconstruct_variant_t &v)
434+
std::uint64_t unlock_time(const tx_reconstruct_variant_t &v)
435435
{
436436
const PreCarrotTransactionProposal *p = std::get_if<PreCarrotTransactionProposal>(&v);
437437
return p ? p->unlock_time : 0;
@@ -836,10 +836,10 @@ std::vector<std::size_t> collect_selected_transfer_indices(const tx_reconstruct_
836836
{
837837
const auto best_transfer_by_ota = collect_non_burned_transfers_by_onetime_address(transfers);
838838

839-
const std::vector<crypto::public_key> spent_onetime_addresses = spent_onetime_addresses_ref(tx_construction_data);
839+
const std::vector<crypto::public_key> spent_otas = spent_onetime_addresses(tx_construction_data);
840840
std::vector<std::size_t> selected_transfer_indices;
841-
selected_transfer_indices.reserve(spent_onetime_addresses.size());
842-
for (const crypto::public_key &spent_onetime_address : spent_onetime_addresses)
841+
selected_transfer_indices.reserve(spent_otas.size());
842+
for (const crypto::public_key &spent_onetime_address : spent_otas)
843843
{
844844
const auto ota_it = best_transfer_by_ota.find(spent_onetime_address);
845845
CARROT_CHECK_AND_THROW(ota_it != best_transfer_by_ota.cend(),
@@ -949,7 +949,7 @@ cryptonote::transaction finalize_fcmps_and_range_proofs(
949949
// collect FCMP paths
950950
std::vector<fcmp_pp::curve_trees::CurveTreesV1::Path> fcmp_paths;
951951
fcmp_paths.reserve(n_inputs);
952-
for (const fcmp_pp::curve_trees::OutputPair input_pair : spent_input_pairs)
952+
for (const fcmp_pp::curve_trees::OutputPair &input_pair : spent_input_pairs)
953953
{
954954
MDEBUG("Requesting FCMP path from tree cache for onetime address " << input_pair.output_pubkey);
955955
fcmp_pp::curve_trees::CurveTreesV1::Path &fcmp_path = fcmp_paths.emplace_back();

src/wallet/tx_builder.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,32 @@ struct PreCarrotTransactionProposal
8787
};
8888

8989
/**
90-
* brief: data to reconstruct any Monero transaction's "signable transaction hash" or "pre-MLSAG hash"
90+
* brief: data to reconstruct any non-coinbase Monero transaction's "signable transaction hash" or "pre-MLSAG hash"
9191
*/
9292
using tx_reconstruct_variant_t = std::variant<
9393
PreCarrotTransactionProposal,
9494
carrot::CarrotTransactionProposalV1
9595
>;
9696
/// destinations for finalized enote (AKA split and w/ change) [requires view-incoming key]
97-
std::vector<cryptonote::tx_destination_entry> finalized_destinations_ref(const tx_reconstruct_variant_t&,
97+
std::vector<cryptonote::tx_destination_entry> finalized_destinations(const tx_reconstruct_variant_t&,
9898
const carrot::view_incoming_key_device &k_view_dev);
9999
/// change destination [requires view-incoming key]
100-
cryptonote::tx_destination_entry change_destination_ref(const tx_reconstruct_variant_t&,
100+
cryptonote::tx_destination_entry change_destination(const tx_reconstruct_variant_t&,
101101
const carrot::view_incoming_key_device &k_view_dev);
102102
/// fee
103-
rct::xmr_amount fee_ref(const tx_reconstruct_variant_t&);
103+
rct::xmr_amount fee(const tx_reconstruct_variant_t&);
104104
/// short payment ID (8 bytes, pre-encryption)
105-
std::optional<crypto::hash8> short_payment_id_ref(const tx_reconstruct_variant_t&);
105+
std::optional<crypto::hash8> short_payment_id(const tx_reconstruct_variant_t&);
106106
/// long payment ID (32 bytes)
107-
std::optional<crypto::hash> long_payment_id_ref(const tx_reconstruct_variant_t&);
107+
std::optional<crypto::hash> long_payment_id(const tx_reconstruct_variant_t&);
108108
/// "true-spend" one-time addresses in inputs (in proposal order, not final tx order)
109-
std::vector<crypto::public_key> spent_onetime_addresses_ref(const tx_reconstruct_variant_t&);
109+
std::vector<crypto::public_key> spent_onetime_addresses(const tx_reconstruct_variant_t&);
110110
/// sum total of input amounts
111-
boost::multiprecision::uint128_t input_amount_total_ref(const tx_reconstruct_variant_t&);
111+
boost::multiprecision::uint128_t input_amount_total(const tx_reconstruct_variant_t&);
112112
/// ring sizes (in proposal order, not final tx order)
113-
std::vector<std::uint64_t> ring_sizes_ref(const tx_reconstruct_variant_t&);
113+
std::vector<std::uint64_t> ring_sizes(const tx_reconstruct_variant_t&);
114114
/// unlock time
115-
std::uint64_t unlock_time_ref(const tx_reconstruct_variant_t&);
115+
std::uint64_t unlock_time(const tx_reconstruct_variant_t&);
116116
/// extra tx fields (includes PIDs and enote ephemeral pubkeys in pre-Carrot ONLY)
117117
const std::vector<std::uint8_t> &extra_ref(const tx_reconstruct_variant_t&);
118118

src/wallet/wallet2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7653,7 +7653,7 @@ void wallet2::commit_tx(pending_tx& ptx)
76537653
uint64_t amount_in = 0;
76547654
if (store_tx_info())
76557655
{
7656-
const crypto::hash8 payment_id_8 = wallet::short_payment_id_ref(ptx.construction_data).value_or(crypto::null_hash8);
7656+
const crypto::hash8 payment_id_8 = wallet::short_payment_id(ptx.construction_data).value_or(crypto::null_hash8);
76577657
memcpy(&payment_id, &payment_id_8, sizeof(crypto::hash8));
76587658
dests = ptx.dests;
76597659
for(size_t idx: ptx.selected_transfers)

0 commit comments

Comments
 (0)