X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Fwalletmodel.cpp;h=faf5049ead72976ab0d5ee6d62dc1d2fcec39b18;hb=f8ea0dd6459856f2df18ca2ad532d49432a087dd;hp=f7658b0f9545fcddbd4627a8bb46b2e50ad952e3;hpb=b032c4a33e27deebe9210347048998ecc4624ee4;p=novacoin.git diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index f7658b0..faf5049 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -207,7 +207,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QListcs_wallet); - std::map::iterator mi = wallet->mapAddressBook.find(dest); + std::map::iterator mi = wallet->mapAddressBook.find(addr); // Check if we have a new address or an updated label if (mi == wallet->mapAddressBook.end() || mi->second != strLabel) { - wallet->SetAddressBookName(dest, strLabel); + wallet->SetAddressBookName(addr, strLabel); } } } @@ -332,11 +332,6 @@ bool WalletModel::changePassphrase(const SecureString &oldPass, const SecureStri return retval; } -void WalletModel::getStakeStats(float &nKernelsRate, float &nCoinDaysRate) -{ - wallet->GetStakeStats(nKernelsRate, nCoinDaysRate); -} - void WalletModel::getStakeWeightFromValue(const int64_t& nTime, const int64_t& nValue, uint64_t& nWeight) { wallet->GetStakeWeightFromValue(nTime, nValue, nWeight); @@ -364,11 +359,11 @@ static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel, CCryptoKeyStor QMetaObject::invokeMethod(walletmodel, "updateStatus", Qt::QueuedConnection); } -static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, ChangeType status) +static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet, const CBitcoinAddress &address, const std::string &label, bool isMine, ChangeType status) { - OutputDebugStringF("NotifyAddressBookChanged %s %s isMine=%i status=%i\n", CBitcoinAddress(address).ToString().c_str(), label.c_str(), isMine, status); + OutputDebugStringF("NotifyAddressBookChanged %s %s isMine=%i status=%i\n", address.ToString().c_str(), label.c_str(), isMine, status); QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection, - Q_ARG(QString, QString::fromStdString(CBitcoinAddress(address).ToString())), + Q_ARG(QString, QString::fromStdString(address.ToString())), Q_ARG(QString, QString::fromStdString(label)), Q_ARG(bool, isMine), Q_ARG(int, status)); @@ -500,10 +495,11 @@ void WalletModel::listCoins(std::map >& mapCoins) cout = COutput(&wallet->mapWallet[cout.tx->vin[0].prevout.hash], cout.tx->vin[0].prevout.n, 0, true); } - CTxDestination address; - if(!out.fSpendable || !ExtractDestination(cout.tx->vout[cout.i].scriptPubKey, address)) + CBitcoinAddress addressRet; + if(!out.fSpendable || !ExtractAddress(*wallet, cout.tx->vout[cout.i].scriptPubKey, addressRet)) continue; - mapCoins[CBitcoinAddress(address).ToString().c_str()].push_back(out); + + mapCoins[addressRet.ToString().c_str()].push_back(out); } } @@ -535,4 +531,4 @@ void WalletModel::clearOrphans() CWallet* WalletModel::getWallet() { return wallet; -} \ No newline at end of file +}