@@ -81,14 +81,14 @@ class AddressTablePriv {
8181 LOCK(wallet->cs_wallet);
8282 for (const std::pair<CTxDestination, CAddressBookData> &item :
8383 wallet->mapAddressBook) {
84- const CBitcoinAddress &address = item.first;
85- bool fMine = IsMine(*wallet, address.Get() );
84+ const CTxDestination &address = item.first;
85+ bool fMine = IsMine(*wallet, address);
8686 AddressTableEntry::Type addressType = translateTransactionType(
8787 QString::fromStdString(item.second.purpose), fMine);
8888 const std::string &strName = item.second.name;
8989 cachedAddressTable.append(AddressTableEntry(
9090 addressType, QString::fromStdString(strName),
91- QString::fromStdString(address.ToString( ))));
91+ QString::fromStdString(EncodeDestination(address ))));
9292 }
9393 }
9494 // qLowerBound() and qUpperBound() require our cachedAddressTable list
@@ -233,7 +233,7 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value,
233233 /* For SetAddressBook / DelAddressBook */
234234 LOCK(wallet->cs_wallet);
235235 CTxDestination curAddress =
236- CBitcoinAddress (rec->address.toStdString()).Get( );
236+ DecodeDestination (rec->address.toStdString());
237237 if (index.column() == Label) {
238238 // Do nothing, if old label == new label
239239 if (rec->label == value.toString()) {
@@ -244,7 +244,7 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value,
244244 strPurpose);
245245 } else if (index.column() == Address) {
246246 CTxDestination newAddress =
247- CBitcoinAddress (value.toString().toStdString()).Get( );
247+ DecodeDestination (value.toString().toStdString());
248248 // Refuse to set invalid address, set error status and return false
249249 if (boost::get<CNoDestination>(&newAddress)) {
250250 editStatus = INVALID_ADDRESS;
@@ -335,8 +335,7 @@ QString AddressTableModel::addRow(const QString &type, const QString &label,
335335 // Check for duplicate addresses
336336 {
337337 LOCK(wallet->cs_wallet);
338- if (wallet->mapAddressBook.count(
339- CBitcoinAddress(strAddress).Get())) {
338+ if (wallet->mapAddressBook.count(DecodeDestination(strAddress))) {
340339 editStatus = DUPLICATE_ADDRESS;
341340 return QString();
342341 }
@@ -356,15 +355,15 @@ QString AddressTableModel::addRow(const QString &type, const QString &label,
356355 return QString();
357356 }
358357 }
359- strAddress = CBitcoinAddress (newKey.GetID()).ToString( );
358+ strAddress = EncodeDestination (newKey.GetID());
360359 } else {
361360 return QString();
362361 }
363362
364363 // Add entry
365364 {
366365 LOCK(wallet->cs_wallet);
367- wallet->SetAddressBook(CBitcoinAddress (strAddress).Get( ), strLabel,
366+ wallet->SetAddressBook(DecodeDestination (strAddress), strLabel,
368367 (type == Send ? "send" : "receive"));
369368 }
370369 return QString::fromStdString(strAddress);
@@ -382,8 +381,7 @@ bool AddressTableModel::removeRows(int row, int count,
382381 }
383382 {
384383 LOCK(wallet->cs_wallet);
385- wallet->DelAddressBook(
386- CBitcoinAddress(rec->address.toStdString()).Get());
384+ wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));
387385 }
388386 return true;
389387}
@@ -393,9 +391,9 @@ bool AddressTableModel::removeRows(int row, int count,
393391QString AddressTableModel::labelForAddress(const QString &address) const {
394392 {
395393 LOCK(wallet->cs_wallet);
396- CBitcoinAddress address_parsed (address.toStdString());
394+ CTxDestination destination = DecodeDestination (address.toStdString());
397395 std::map<CTxDestination, CAddressBookData>::iterator mi =
398- wallet->mapAddressBook.find(address_parsed.Get() );
396+ wallet->mapAddressBook.find(destination );
399397 if (mi != wallet->mapAddressBook.end()) {
400398 return QString::fromStdString(mi->second.name);
401399 }
0 commit comments