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 Oct 7, 2019
1 parent 7126df8 commit 721b341
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 @@ -3085,8 +3085,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 @@ -3261,6 +3259,7 @@ bool ReserveDestination::GetReservedDestination(const OutputType type, CTxDestin
return false;
}

m_spk_man->TopUp();

if (nIndex == -1)
{
Expand Down

0 comments on commit 721b341

Please sign in to comment.