upstream: add is_out_to_acc_precomp span overload

This commit is contained in:
jeffro256
2025-04-16 18:39:32 -05:00
committed by akildemir
parent 3a21213153
commit c607f23a60
2 changed files with 28 additions and 1 deletions

View File

@@ -1297,7 +1297,14 @@ namespace cryptonote
return false;
}
//---------------------------------------------------------------
boost::optional<subaddress_receive_info> is_out_to_acc_precomp(const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, const crypto::public_key& out_key, const crypto::key_derivation& derivation, const std::vector<crypto::key_derivation>& additional_derivations, size_t output_index, hw::device &hwdev, const boost::optional<crypto::view_tag>& view_tag_opt)
boost::optional<subaddress_receive_info> is_out_to_acc_precomp(
const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses,
const crypto::public_key& out_key,
const crypto::key_derivation& derivation,
const epee::span<const crypto::key_derivation> additional_derivations,
size_t output_index,
hw::device &hwdev,
const boost::optional<crypto::view_tag>& view_tag_opt)
{
// try the shared tx pubkey
crypto::public_key subaddress_spendkey;
@@ -1334,6 +1341,24 @@ namespace cryptonote
return boost::none;
}
//---------------------------------------------------------------
boost::optional<subaddress_receive_info> is_out_to_acc_precomp(
const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses,
const crypto::public_key& out_key,
const crypto::key_derivation& derivation,
const std::vector<crypto::key_derivation>& additional_derivations,
size_t output_index,
hw::device &hwdev,
const boost::optional<crypto::view_tag>& 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<size_t>& outs, uint64_t& money_transfered)
{
crypto::public_key tx_pub_key = get_tx_pub_key_from_extra(tx);

View File

@@ -38,6 +38,7 @@
#include "include_base_utils.h"
#include "crypto/crypto.h"
#include "crypto/hash.h"
#include "span.h"
#include <unordered_map>
#include <boost/multiprecision/cpp_int.hpp>
@@ -100,6 +101,7 @@ namespace cryptonote
subaddress_index index;
crypto::key_derivation derivation;
};
boost::optional<subaddress_receive_info> is_out_to_acc_precomp(const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, const crypto::public_key& out_key, const crypto::key_derivation& derivation, const epee::span<const crypto::key_derivation> additional_derivations, size_t output_index, hw::device &hwdev, const boost::optional<crypto::view_tag>& view_tag_opt = boost::optional<crypto::view_tag>());
boost::optional<subaddress_receive_info> is_out_to_acc_precomp(const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, const crypto::public_key& out_key, const crypto::key_derivation& derivation, const std::vector<crypto::key_derivation>& additional_derivations, size_t output_index, hw::device &hwdev, const boost::optional<crypto::view_tag>& view_tag_opt = boost::optional<crypto::view_tag>());
bool lookup_acc_outs(const account_keys& acc, const transaction& tx, const crypto::public_key& tx_pub_key, const std::vector<crypto::public_key>& additional_tx_public_keys, std::vector<size_t>& outs, uint64_t& money_transfered);
bool lookup_acc_outs(const account_keys& acc, const transaction& tx, std::vector<size_t>& outs, uint64_t& money_transfered);