Skip to content

Commit

Permalink
Fix negative "keys left since backup" (#2671)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Feb 1, 2019
1 parent 2a330f1 commit ae70e8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4262,8 +4262,10 @@ void CWallet::KeepKey(int64_t nIndex)
if (fFileBacked)
{
CWalletDB walletdb(strWalletFile);
walletdb.ErasePool(nIndex);
nKeysLeftSinceAutoBackup = nWalletBackups ? nKeysLeftSinceAutoBackup - 1 : 0;
if (walletdb.ErasePool(nIndex))
--nKeysLeftSinceAutoBackup;
if (!nWalletBackups)
nKeysLeftSinceAutoBackup = 0;
}
LogPrintf("keypool keep %d\n", nIndex);
}
Expand Down

0 comments on commit ae70e8a

Please sign in to comment.