Skip to content

Commit

Permalink
wallet: Avoid updating ReserveDestination::nIndex when `GetReserved…
Browse files Browse the repository at this point in the history
…Destination` fails

Github-Pull: bitcoin#29510
Rebased-From: 367bb7a
  • Loading branch information
UdjinM6 authored and achow101 committed Mar 1, 2024
1 parent 1ce5acc commit 7c08ccf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2596,8 +2596,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;
}
Expand Down

0 comments on commit 7c08ccf

Please sign in to comment.