X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwallet.cpp;h=1846d17c923e8350b728f40e1200a55be32fc8f1;hb=1ebe5b92ef18395cdae9b88fc38b0ed6166c3243;hp=c7206156474850450104ba1d2087019944f536d7;hpb=46b969fc077d929f6e73266fe7c0b5d1f9b42e18;p=novacoin.git diff --git a/src/wallet.cpp b/src/wallet.cpp index c720615..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 @@ -2121,7 +2121,6 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) AddToWallet(wtxNew); // Mark old coins as spent - set setCoins; BOOST_FOREACH(const CTxIn& txin, wtxNew.vin) { CWalletTx &coin = mapWallet[txin.prevout.hash]; @@ -2811,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; @@ -2820,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) @@ -2830,17 +2829,17 @@ bool CWallet::ExtractAddress(const CScript& scriptPubKey, std::string& addressRe if (!CheckOwnership(CPubKey(vSolutions[0]), CPubKey(vSolutions[1]), view)) return false; - addressRet = 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...