@@ -82,14 +82,14 @@ class AddressTablePriv
82
82
LOCK (wallet->cs_wallet );
83
83
for (const std::pair<CTxDestination, CAddressBookData>& item : wallet->mapAddressBook )
84
84
{
85
- const CBitcoinAddress & address = item.first ;
86
- bool fMine = IsMine (*wallet, address. Get () );
85
+ const CTxDestination & address = item.first ;
86
+ bool fMine = IsMine (*wallet, address);
87
87
AddressTableEntry::Type addressType = translateTransactionType (
88
88
QString::fromStdString (item.second .purpose ), fMine );
89
89
const std::string& strName = item.second .name ;
90
90
cachedAddressTable.append (AddressTableEntry (addressType,
91
91
QString::fromStdString (strName),
92
- QString::fromStdString (address. ToString ( ))));
92
+ QString::fromStdString (EncodeDestination (address ))));
93
93
}
94
94
}
95
95
// qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
@@ -246,7 +246,7 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value,
246
246
if (role == Qt::EditRole)
247
247
{
248
248
LOCK (wallet->cs_wallet ); /* For SetAddressBook / DelAddressBook */
249
- CTxDestination curAddress = CBitcoinAddress (rec->address .toStdString ()). Get ( );
249
+ CTxDestination curAddress = DecodeDestination (rec->address .toStdString ());
250
250
if (index.column () == Label)
251
251
{
252
252
// Do nothing, if old label == new label
@@ -257,7 +257,7 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value,
257
257
}
258
258
wallet->SetAddressBook (curAddress, value.toString ().toStdString (), strPurpose);
259
259
} else if (index.column () == Address) {
260
- CTxDestination newAddress = CBitcoinAddress (value.toString ().toStdString ()). Get ( );
260
+ CTxDestination newAddress = DecodeDestination (value.toString ().toStdString ());
261
261
// Refuse to set invalid address, set error status and return false
262
262
if (boost::get<CNoDestination>(&newAddress))
263
263
{
@@ -358,7 +358,7 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
358
358
// Check for duplicate addresses
359
359
{
360
360
LOCK (wallet->cs_wallet );
361
- if (wallet->mapAddressBook .count (CBitcoinAddress (strAddress). Get ( )))
361
+ if (wallet->mapAddressBook .count (DecodeDestination (strAddress)))
362
362
{
363
363
editStatus = DUPLICATE_ADDRESS;
364
364
return QString ();
@@ -384,7 +384,7 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
384
384
return QString ();
385
385
}
386
386
}
387
- strAddress = CBitcoinAddress (newKey.GetID ()). ToString ( );
387
+ strAddress = EncodeDestination (newKey.GetID ());
388
388
}
389
389
else
390
390
{
@@ -394,7 +394,7 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
394
394
// Add entry
395
395
{
396
396
LOCK (wallet->cs_wallet );
397
- wallet->SetAddressBook (CBitcoinAddress (strAddress). Get ( ), strLabel,
397
+ wallet->SetAddressBook (DecodeDestination (strAddress), strLabel,
398
398
(type == Send ? " send" : " receive" ));
399
399
}
400
400
return QString::fromStdString (strAddress);
@@ -412,7 +412,7 @@ bool AddressTableModel::removeRows(int row, int count, const QModelIndex &parent
412
412
}
413
413
{
414
414
LOCK (wallet->cs_wallet );
415
- wallet->DelAddressBook (CBitcoinAddress (rec->address .toStdString ()). Get ( ));
415
+ wallet->DelAddressBook (DecodeDestination (rec->address .toStdString ()));
416
416
}
417
417
return true ;
418
418
}
@@ -423,8 +423,8 @@ QString AddressTableModel::labelForAddress(const QString &address) const
423
423
{
424
424
{
425
425
LOCK (wallet->cs_wallet );
426
- CBitcoinAddress address_parsed (address.toStdString ());
427
- std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook .find (address_parsed. Get () );
426
+ CTxDestination destination = DecodeDestination (address.toStdString ());
427
+ std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook .find (destination );
428
428
if (mi != wallet->mapAddressBook .end ())
429
429
{
430
430
return QString::fromStdString (mi->second .name );
0 commit comments