Skip to content

Commit

Permalink
Key pool: Move TopUp call
Browse files Browse the repository at this point in the history
This avoids extra keyman map lookup:
bitcoin#16341 (comment), but may be
"annoying" and lead to unnecessary topups in some situations:
bitcoin#16341 (comment)
  • Loading branch information
achow101 committed Nov 4, 2019
1 parent f662281 commit 17baba8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3075,8 +3075,6 @@ bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& des
LOCK(cs_wallet);
error.clear();

m_spk_man->TopUp();

ReserveDestination reservedest(this);
if (!reservedest.GetReservedDestination(type, dest, true)) {
error = "Error: Keypool ran out, please call keypoolrefill first";
Expand Down Expand Up @@ -3251,6 +3249,7 @@ bool ReserveDestination::GetReservedDestination(const OutputType type, CTxDestin
return false;
}

m_spk_man->TopUp();

if (nIndex == -1)
{
Expand Down

0 comments on commit 17baba8

Please sign in to comment.