diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index cb31fbc6a5..710f56dcba 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1958,7 +1958,11 @@ bool CWallet::CreateTransaction(const vector >& 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()); }