Skip to content

Commit

Permalink
Merge pull request #2337 from barton2526/walletbugfix
Browse files Browse the repository at this point in the history
wallet: Bugfix - Fundrawtransaction: don't terminate when keypool is empty
  • Loading branch information
jamescowens authored Sep 20, 2021
2 parents a9bef21 + 86b8027 commit 27a6a6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,11 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,

// Reserve a new key pair from key pool
CPubKey vchPubKey;
assert(reservekey.GetReservedKey(vchPubKey)); // should never fail, as we just unlocked
if (!reservekey.GetReservedKey(vchPubKey))
{
LogPrintf("Keypool ran out, please call keypoolrefill first");
return false;
}

scriptChange.SetDestination(vchPubKey.GetID());
}
Expand Down

0 comments on commit 27a6a6a

Please sign in to comment.