diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2022-04-19 22:14:03 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2022-04-19 22:14:03 -0500 |
| commit | 96758a7d05bb1747951ffac87a307d592f882655 (patch) | |
| tree | 20900ece7aacd538bb3bacba72e7592e03bd915f /src/device/device_default.cpp | |
| parent | 53bf62d11457b011ac77d6d2947e662259cfec5e (diff) | |
| parent | ea87b30f8907ee11252433811e7a7d0c46758cca (diff) | |
| download | monzero-core-96758a7d05bb1747951ffac87a307d592f882655.tar.gz monzero-core-96758a7d05bb1747951ffac87a307d592f882655.tar.xz monzero-core-96758a7d05bb1747951ffac87a307d592f882655.zip | |
Merge pull request #8061
ea87b30 Add view tags to outputs to reduce wallet scanning time (j-berman)
Diffstat (limited to 'src/device/device_default.cpp')
| -rw-r--r-- | src/device/device_default.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/device/device_default.cpp b/src/device/device_default.cpp index e7b452d40..d70ece229 100644 --- a/src/device/device_default.cpp +++ b/src/device/device_default.cpp @@ -263,6 +263,11 @@ namespace hw { return true; } + bool device_default::derive_view_tag(const crypto::key_derivation &derivation, const std::size_t output_index, crypto::view_tag &view_tag) { + crypto::derive_view_tag(derivation, output_index, view_tag); + return true; + } + bool device_default::conceal_derivation(crypto::key_derivation &derivation, const crypto::public_key &tx_pub_key, const std::vector<crypto::public_key> &additional_tx_pub_keys, const crypto::key_derivation &main_derivation, const std::vector<crypto::key_derivation> &additional_derivations){ return true; } @@ -291,7 +296,8 @@ namespace hw { const cryptonote::tx_destination_entry &dst_entr, const boost::optional<cryptonote::account_public_address> &change_addr, const size_t output_index, const bool &need_additional_txkeys, const std::vector<crypto::secret_key> &additional_tx_keys, std::vector<crypto::public_key> &additional_tx_public_keys, - std::vector<rct::key> &amount_keys, crypto::public_key &out_eph_public_key) { + std::vector<rct::key> &amount_keys, crypto::public_key &out_eph_public_key, + const bool use_view_tags, crypto::view_tag &view_tag) { crypto::key_derivation derivation; @@ -331,6 +337,12 @@ namespace hw { derivation_to_scalar(derivation, output_index, scalar1); amount_keys.push_back(rct::sk2rct(scalar1)); } + + if (use_view_tags) + { + derive_view_tag(derivation, output_index, view_tag); + } + r = derive_public_key(derivation, output_index, dst_entr.addr.m_spend_public_key, out_eph_public_key); CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to derive_public_key(" << derivation << ", " << output_index << ", "<< dst_entr.addr.m_spend_public_key << ")"); |
