X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcwallet.cpp;h=b96f5c11157a1b51d7fcfbfbb4e80fa6244af168;hb=377ff13ab1aa46e67f75d58a4adf597350455045;hp=0d0946e0c0723030a2959f5704b16714d65e9f33;hpb=81aaaf43084ca0b9473e7a85e6833301cba09c30;p=novacoin.git diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 0d0946e..b96f5c1 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1511,7 +1511,7 @@ void ThreadCleanWalletPassphrase(void* parg) { nWalletUnlockTime = nMyWakeTime; - do + for ( ; ; ) { if (nWalletUnlockTime==0) break; @@ -1523,7 +1523,7 @@ void ThreadCleanWalletPassphrase(void* parg) Sleep(nToSleep); ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime); - } while(1); + }; if (nWalletUnlockTime) { @@ -1893,13 +1893,15 @@ Value makekeypair(const Array& params, bool fHelp) Value newmalleablekey(const Array& params, bool fHelp) { - if (fHelp || params.size() > 0) + if (fHelp || params.size() > 1) throw runtime_error( "newmalleablekey\n" "Make a malleable public/private key pair.\n"); - if (!(fDebug || fTestNet) && GetTime() < SMALLDATA_SWITCH_TIME) - throw runtime_error("This feature has been disabled for mainNet clients"); + // Parse the account first so we don't generate a key if there's an error + string strAccount; + if (params.size() > 0) + strAccount = AccountFromValue(params[0]); CMalleableKeyView keyView = pwalletMain->GenerateNewMalleableKey(); @@ -1908,11 +1910,14 @@ Value newmalleablekey(const Array& params, bool fHelp) throw runtime_error("Unable to generate new malleable key"); CMalleablePubKey mPubKey = mKey.GetMalleablePubKey(); + CBitcoinAddress address(mPubKey); + + pwalletMain->SetAddressBookName(address, strAccount); Object result; result.push_back(Pair("PublicPair", mPubKey.ToString())); result.push_back(Pair("PublicBytes", HexStr(mPubKey.Raw()))); - result.push_back(Pair("Address", CBitcoinAddress(mPubKey).ToString())); + result.push_back(Pair("Address", address.ToString())); result.push_back(Pair("KeyView", keyView.ToString())); return result;