diff options
| author | Gavin Andresen <[email protected]> | 2011-09-01 18:40:18 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-09-01 18:40:18 -0400 |
| commit | 2f4c30fd85aed8227612ee9986226850723c6860 (patch) | |
| tree | e1e698499d3d17e6843f11d78743e9eddb095fb0 /src/rpc.cpp | |
| parent | Fixed regression I introduced: wallets with lots of transactions were unusabl... (diff) | |
| download | discoin-2f4c30fd85aed8227612ee9986226850723c6860.tar.xz discoin-2f4c30fd85aed8227612ee9986226850723c6860.zip | |
Fix bad merge: getaccountaddress was broken for new accounts
Diffstat (limited to 'src/rpc.cpp')
| -rw-r--r-- | src/rpc.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rpc.cpp b/src/rpc.cpp index ec2bb2a97..4f4342770 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -379,14 +379,11 @@ CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false) // Generate a new key if (account.vchPubKey.empty() || bForceNew || bKeyUsed) { - if (pwalletMain->GetKeyPoolSize() < 1) - { - if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false)) - throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first"); + if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false)) + throw JSONRPCError(-12, "Error: Keypool ran out, please call keypoolrefill first"); - pwalletMain->SetAddressBookName(CBitcoinAddress(account.vchPubKey), strAccount); - walletdb.WriteAccount(strAccount, account); - } + pwalletMain->SetAddressBookName(CBitcoinAddress(account.vchPubKey), strAccount); + walletdb.WriteAccount(strAccount, account); } return CBitcoinAddress(account.vchPubKey); |