diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -84,23 +84,23 @@ QString::fromStdString(EncodeCashAddr( address.dest, parent->walletModel->getChainParams())))); } - // qLowerBound() and qUpperBound() require our cachedAddressTable list - // to be sorted in asc order. Even though the map is already sorted this - // re-sorting step is needed because the originating map is sorted by - // binary address, not by base58() address. - qSort(cachedAddressTable.begin(), cachedAddressTable.end(), - AddressTableEntryLessThan()); + // std::lower_bound() and std::upper_bound() require our + // cachedAddressTable list to be sorted in asc order Even though the map + // is already sorted this re-sorting step is needed because the + // originating map is sorted by binary address, not by base58() address. + std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), + AddressTableEntryLessThan()); } void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status) { // Find address / label in model - QList::iterator lower = - qLowerBound(cachedAddressTable.begin(), cachedAddressTable.end(), - address, AddressTableEntryLessThan()); - QList::iterator upper = - qUpperBound(cachedAddressTable.begin(), cachedAddressTable.end(), - address, AddressTableEntryLessThan()); + QList::iterator lower = std::lower_bound( + cachedAddressTable.begin(), cachedAddressTable.end(), address, + AddressTableEntryLessThan()); + QList::iterator upper = std::upper_bound( + cachedAddressTable.begin(), cachedAddressTable.end(), address, + AddressTableEntryLessThan()); int lowerIndex = (lower - cachedAddressTable.begin()); int upperIndex = (upper - cachedAddressTable.begin()); bool inModel = (lower != upper); diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include #include #include @@ -89,9 +91,9 @@ QString::number(status); // Find bounds of this transaction in model - QList::iterator lower = qLowerBound( + QList::iterator lower = std::lower_bound( cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); - QList::iterator upper = qUpperBound( + QList::iterator upper = std::upper_bound( cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); int lowerIndex = (lower - cachedWallet.begin()); int upperIndex = (upper - cachedWallet.begin());