Skip to content

Commit 367bb7a

Browse files
committed
wallet: Avoid updating ReserveDestination::nIndex when GetReservedDestination fails
1 parent ba907f9 commit 367bb7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2607,8 +2607,10 @@ util::Result<CTxDestination> ReserveDestination::GetReservedDestination(bool int
26072607

26082608
if (nIndex == -1) {
26092609
CKeyPool keypool;
2610-
auto op_address = m_spk_man->GetReservedDestination(type, internal, nIndex, keypool);
2610+
int64_t index;
2611+
auto op_address = m_spk_man->GetReservedDestination(type, internal, index, keypool);
26112612
if (!op_address) return op_address;
2613+
nIndex = index;
26122614
address = *op_address;
26132615
fInternal = keypool.fInternal;
26142616
}

0 commit comments

Comments
 (0)