X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwallet.cpp;h=1846d17c923e8350b728f40e1200a55be32fc8f1;hb=1ebe5b92ef18395cdae9b88fc38b0ed6166c3243;hp=908afaa4998628279ba05428587f2c11a7482ab0;hpb=fbd44e84d5841867d36d295d4f347fd5e55d293f;p=novacoin.git diff --git a/src/wallet.cpp b/src/wallet.cpp index 908afaa..1846d17 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1688,8 +1688,8 @@ bool CWallet::CreateTransaction(const vector >& vecSend, CScript scriptChange; // coin control: send change to custom address - if (coinControl && !boost::get(&coinControl->destChange)) - scriptChange.SetDestination(coinControl->destChange); + if (coinControl && coinControl->destChange.IsValid()) + scriptChange.SetAddress(coinControl->destChange); // no coin control: send change to newly generated address else @@ -2810,7 +2810,7 @@ void CWallet::ClearOrphans() EraseFromWallet(*it); } -bool CWallet::ExtractAddress(const CScript& scriptPubKey, std::string& addressRet) +bool CWallet::ExtractAddress(const CScript& scriptPubKey, CBitcoinAddress& addressRet) { vector vSolutions; txnouttype whichType; @@ -2819,7 +2819,7 @@ bool CWallet::ExtractAddress(const CScript& scriptPubKey, std::string& addressRe if (whichType == TX_PUBKEY) { - addressRet = CBitcoinAddress(CPubKey(vSolutions[0]).GetID()).ToString(); + addressRet = CBitcoinAddress(CPubKey(vSolutions[0]).GetID()); return true; } if (whichType == TX_PUBKEY_DROP) @@ -2829,17 +2829,17 @@ bool CWallet::ExtractAddress(const CScript& scriptPubKey, std::string& addressRe if (!CheckOwnership(CPubKey(vSolutions[0]), CPubKey(vSolutions[1]), view)) return false; - addressRet = CBitcoinAddress(view.GetMalleablePubKey()).ToString(); + addressRet = CBitcoinAddress(view.GetMalleablePubKey()); return true; } else if (whichType == TX_PUBKEYHASH) { - addressRet = CBitcoinAddress(CKeyID(uint160(vSolutions[0]))).ToString(); + addressRet = CBitcoinAddress(CKeyID(uint160(vSolutions[0]))); return true; } else if (whichType == TX_SCRIPTHASH) { - addressRet = CBitcoinAddress(CScriptID(uint160(vSolutions[0]))).ToString(); + addressRet = CBitcoinAddress(CScriptID(uint160(vSolutions[0]))); return true; } // Multisig txns have more than one address...