diff options
author | luigi1111 <luigi1111w@gmail.com> | 2022-12-01 01:08:11 -0600 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2022-12-01 01:08:11 -0600 |
commit | 179a87afae62c92b9e09cbf59c805da4ff5cae83 (patch) | |
tree | d6a45aa4a2916767b8fbf057863980e408660983 /src/wallet/wallet2.cpp | |
parent | Merge pull request #8610 (diff) | |
parent | wallet2: fix create view-only wallet from existing wallet (diff) | |
download | monero-179a87afae62c92b9e09cbf59c805da4ff5cae83.tar.xz |
Merge pull request #8616
cac5083 wallet2: fix create view-only wallet from existing wallet (j-berman)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a1a51f7de..1880d7ea0 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -13330,9 +13330,7 @@ size_t wallet2::import_outputs(const std::tuple<uint64_t, uint64_t, std::vector< THROW_WALLET_EXCEPTION_IF(offset > m_transfers.size(), error::wallet_internal_error, "Imported outputs omit more outputs that we know of"); - THROW_WALLET_EXCEPTION_IF(offset >= num_outputs, error::wallet_internal_error, - "Offset is larger than total outputs"); - THROW_WALLET_EXCEPTION_IF(output_array.size() > num_outputs - offset, error::wallet_internal_error, + THROW_WALLET_EXCEPTION_IF(offset + output_array.size() > num_outputs, error::wallet_internal_error, "Offset is larger than total outputs"); const size_t original_size = m_transfers.size(); @@ -13412,9 +13410,7 @@ size_t wallet2::import_outputs(const std::tuple<uint64_t, uint64_t, std::vector< THROW_WALLET_EXCEPTION_IF(offset > m_transfers.size(), error::wallet_internal_error, "Imported outputs omit more outputs that we know of. Try using export_outputs all."); - THROW_WALLET_EXCEPTION_IF(offset >= num_outputs, error::wallet_internal_error, - "Offset is larger than total outputs"); - THROW_WALLET_EXCEPTION_IF(output_array.size() > num_outputs - offset, error::wallet_internal_error, + THROW_WALLET_EXCEPTION_IF(offset + output_array.size() > num_outputs, error::wallet_internal_error, "Offset is larger than total outputs"); const size_t original_size = m_transfers.size(); |