diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-11-08 22:34:26 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-11-08 22:34:26 +0200 |
commit | 4c44d896d3957fdfe1ec8c2b5c51b482a3746d6a (patch) | |
tree | e4342e2a40904530cfb61f15f62fac06e2a6852e /src/cryptonote_core | |
parent | Merge pull request #1284 (diff) | |
parent | refresh speedup (diff) | |
download | monero-4c44d896d3957fdfe1ec8c2b5c51b482a3746d6a.tar.xz |
Merge pull request #1285
a970a4e refresh speedup (luigi1111)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.cpp | 7 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 6d64a43cb..234422e3d 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -876,6 +876,13 @@ namespace cryptonote return pk == out_key.key; } //--------------------------------------------------------------- + bool is_out_to_acc_precomp(const crypto::public_key& spend_public_key, const txout_to_key& out_key, const crypto::key_derivation& derivation, size_t output_index) + { + crypto::public_key pk; + derive_public_key(derivation, output_index, spend_public_key, pk); + return pk == out_key.key; + } + //--------------------------------------------------------------- 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); diff --git a/src/cryptonote_core/cryptonote_format_utils.h b/src/cryptonote_core/cryptonote_format_utils.h index 24db8008e..d5dd6494d 100644 --- a/src/cryptonote_core/cryptonote_format_utils.h +++ b/src/cryptonote_core/cryptonote_format_utils.h @@ -115,6 +115,7 @@ namespace cryptonote bool get_payment_id_from_tx_extra_nonce(const blobdata& extra_nonce, crypto::hash& payment_id); bool get_encrypted_payment_id_from_tx_extra_nonce(const blobdata& extra_nonce, crypto::hash8& payment_id); bool is_out_to_acc(const account_keys& acc, const txout_to_key& out_key, const crypto::public_key& tx_pub_key, size_t output_index); + bool is_out_to_acc_precomp(const crypto::public_key& spend_public_key, const txout_to_key& out_key, const crypto::key_derivation& derivation, size_t output_index); bool lookup_acc_outs(const account_keys& acc, const transaction& tx, const crypto::public_key& tx_pub_key, 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); bool get_tx_fee(const transaction& tx, uint64_t & fee); |