Skip to content

Commit c24a4f5

Browse files
committed
[Wallet] Bugfix: FRT: don't terminate when keypool is empty
1 parent 919db03 commit c24a4f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,11 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
23892389
CPubKey vchPubKey;
23902390
bool ret;
23912391
ret = reservekey.GetReservedKey(vchPubKey);
2392-
assert(ret); // should never fail, as we just unlocked
2392+
if (!ret)
2393+
{
2394+
strFailReason = _("Keypool ran out, please call keypoolrefill first");
2395+
return false;
2396+
}
23932397

23942398
scriptChange = GetScriptForDestination(vchPubKey.GetID());
23952399
}

0 commit comments

Comments
 (0)