From c607f23a601a85e8856baed75c62b7f120ab75cd Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Wed, 16 Apr 2025 18:39:32 -0500 Subject: [PATCH] upstream: add is_out_to_acc_precomp span overload --- .../cryptonote_format_utils.cpp | 27 ++++++++++++++++++- .../cryptonote_format_utils.h | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index 6978ab0d4..e80130913 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -1297,7 +1297,14 @@ namespace cryptonote return false; } //--------------------------------------------------------------- - boost::optional is_out_to_acc_precomp(const std::unordered_map& subaddresses, const crypto::public_key& out_key, const crypto::key_derivation& derivation, const std::vector& additional_derivations, size_t output_index, hw::device &hwdev, const boost::optional& view_tag_opt) + boost::optional is_out_to_acc_precomp( + const std::unordered_map& subaddresses, + const crypto::public_key& out_key, + const crypto::key_derivation& derivation, + const epee::span additional_derivations, + size_t output_index, + hw::device &hwdev, + const boost::optional& view_tag_opt) { // try the shared tx pubkey crypto::public_key subaddress_spendkey; @@ -1334,6 +1341,24 @@ namespace cryptonote return boost::none; } //--------------------------------------------------------------- + boost::optional is_out_to_acc_precomp( + const std::unordered_map& subaddresses, + const crypto::public_key& out_key, + const crypto::key_derivation& derivation, + const std::vector& additional_derivations, + size_t output_index, + hw::device &hwdev, + const boost::optional& view_tag_opt) + { + return is_out_to_acc_precomp(subaddresses, + out_key, + derivation, + epee::to_span(additional_derivations), + output_index, + hwdev, + view_tag_opt); + } + //--------------------------------------------------------------- bool lookup_acc_outs(const account_keys& acc, const transaction& tx, std::vector& outs, uint64_t& money_transfered) { crypto::public_key tx_pub_key = get_tx_pub_key_from_extra(tx); diff --git a/src/cryptonote_basic/cryptonote_format_utils.h b/src/cryptonote_basic/cryptonote_format_utils.h index 5652939fc..ccf4104b7 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.h +++ b/src/cryptonote_basic/cryptonote_format_utils.h @@ -38,6 +38,7 @@ #include "include_base_utils.h" #include "crypto/crypto.h" #include "crypto/hash.h" +#include "span.h" #include #include @@ -100,6 +101,7 @@ namespace cryptonote subaddress_index index; crypto::key_derivation derivation; }; + boost::optional is_out_to_acc_precomp(const std::unordered_map& subaddresses, const crypto::public_key& out_key, const crypto::key_derivation& derivation, const epee::span additional_derivations, size_t output_index, hw::device &hwdev, const boost::optional& view_tag_opt = boost::optional()); boost::optional is_out_to_acc_precomp(const std::unordered_map& subaddresses, const crypto::public_key& out_key, const crypto::key_derivation& derivation, const std::vector& additional_derivations, size_t output_index, hw::device &hwdev, const boost::optional& view_tag_opt = boost::optional()); bool lookup_acc_outs(const account_keys& acc, const transaction& tx, const crypto::public_key& tx_pub_key, const std::vector& additional_tx_public_keys, std::vector& outs, uint64_t& money_transfered); bool lookup_acc_outs(const account_keys& acc, const transaction& tx, std::vector& outs, uint64_t& money_transfered);