aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUdjinM6 <UdjinM6@users.noreply.github.com>2024-02-28 13:00:00 +0300
committerglozow <gloriajzhao@gmail.com>2024-03-05 10:49:41 +0000
commit7c82b2758c6bcfb8a94d2086f0d40088286815e8 (patch)
tree90070e22337edd790f126f2b8d4c7601b9644449
parentb5419ce6b621121bb1a0ec497968eb16cc012c39 (diff)
wallet: Avoid updating `ReserveDestination::nIndex` when `GetReservedDestination` fails
Github-Pull: #29510 Rebased-From: 367bb7a80cc71130995672c853d4a6e0134721d6
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 78febb8195..31372cb3da 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2561,8 +2561,10 @@ util::Result<CTxDestination> ReserveDestination::GetReservedDestination(bool int
if (nIndex == -1) {
CKeyPool keypool;
- auto op_address = m_spk_man->GetReservedDestination(type, internal, nIndex, keypool);
+ int64_t index;
+ auto op_address = m_spk_man->GetReservedDestination(type, internal, index, keypool);
if (!op_address) return op_address;
+ nIndex = index;
address = *op_address;
fInternal = keypool.fInternal;
}