From 85c9fe515d19728a9811f11a67c38266a72c0b94 Mon Sep 17 00:00:00 2001 From: j-berman Date: Tue, 18 Oct 2022 13:47:50 -0500 Subject: wallet2: fix create view-only wallet from existing wallet --- src/wallet/wallet2.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/wallet/wallet2.cpp') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 17ff0e44b..91de4fe09 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -13326,9 +13326,7 @@ size_t wallet2::import_outputs(const std::tuple 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(); @@ -13408,9 +13406,7 @@ size_t wallet2::import_outputs(const std::tuple 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(); -- cgit v1.2.3