aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUdjinM6 <UdjinM6@users.noreply.github.com>2024-02-28 13:00:00 +0300
committerUdjinM6 <UdjinM6@users.noreply.github.com>2024-02-28 13:00:00 +0300
commit367bb7a80cc71130995672c853d4a6e0134721d6 (patch)
tree7c5e344bac38c2a2373499624b26546986754cb2 /src
parentba907f96ad37c09c49c0e1532fad118fcb8dd4a8 (diff)
wallet: Avoid updating `ReserveDestination::nIndex` when `GetReservedDestination` fails
Diffstat (limited to 'src')
-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 26c5256f6f..3ac09430d8 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2607,8 +2607,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;
}