Skip to content

Commit 27a6a6a

Browse files
authored
Merge pull request #2337 from barton2526/walletbugfix
wallet: Bugfix - Fundrawtransaction: don't terminate when keypool is empty
2 parents a9bef21 + 86b8027 commit 27a6a6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/wallet/wallet.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,11 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
19581958

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

19631967
scriptChange.SetDestination(vchPubKey.GetID());
19641968
}

0 commit comments

Comments
 (0)