Logic running with -keypool=0 was wrong (empty keys were being returned). Fixes #445

Renames GetOrReuseKeyFromKeyPool to GetKeyFromPool, with fAllowReuse arg and bool result.
This commit is contained in:
Gavin Andresen
2011-08-12 16:32:07 -04:00
parent f662cefd85
commit 7db3b75b3e
5 changed files with 42 additions and 25 deletions

View File

@@ -1391,7 +1391,9 @@ void CMainFrame::OnButtonNew(wxCommandEvent& event)
return;
// Generate new key
strAddress = CBitcoinAddress(pwalletMain->GetOrReuseKeyFromPool()).ToString();
std::vector<unsigned char> newKey;
pwalletMain->GetKeyFromPool(newKey, true);
strAddress = CBitcoinAddress(newKey).ToString();
if (fWasLocked)
pwalletMain->Lock();
@@ -2826,7 +2828,9 @@ void CAddressBookDialog::OnButtonNew(wxCommandEvent& event)
return;
// Generate new key
strAddress = CBitcoinAddress(pwalletMain->GetOrReuseKeyFromPool()).ToString();
std::vector<unsigned char> newKey;
pwalletMain->GetKeyFromPool(newKey, true);
strAddress = CBitcoinAddress(newKey).ToString();
if (fWasLocked)
pwalletMain->Lock();