Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiontablemodel.cpp
Show All 14 Lines | |||||
#include <qt/transactiondesc.h> | #include <qt/transactiondesc.h> | ||||
#include <qt/transactionrecord.h> | #include <qt/transactionrecord.h> | ||||
#include <qt/walletmodel.h> | #include <qt/walletmodel.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <uint256.h> | #include <uint256.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <algorithm> | |||||
#include <QColor> | #include <QColor> | ||||
#include <QDateTime> | #include <QDateTime> | ||||
#include <QDebug> | #include <QDebug> | ||||
#include <QIcon> | #include <QIcon> | ||||
#include <QList> | #include <QList> | ||||
// Amount column is right-aligned it contains numbers | // Amount column is right-aligned it contains numbers | ||||
static int column_alignments[] = { | static int column_alignments[] = { | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | public: | ||||
*/ | */ | ||||
void updateWallet(interfaces::Wallet &wallet, const TxId &txid, int status, | void updateWallet(interfaces::Wallet &wallet, const TxId &txid, int status, | ||||
bool showTransaction) { | bool showTransaction) { | ||||
qDebug() << "TransactionTablePriv::updateWallet: " + | qDebug() << "TransactionTablePriv::updateWallet: " + | ||||
QString::fromStdString(txid.ToString()) + " " + | QString::fromStdString(txid.ToString()) + " " + | ||||
QString::number(status); | QString::number(status); | ||||
// Find bounds of this transaction in model | // Find bounds of this transaction in model | ||||
QList<TransactionRecord>::iterator lower = qLowerBound( | QList<TransactionRecord>::iterator lower = std::lower_bound( | ||||
cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); | cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); | ||||
QList<TransactionRecord>::iterator upper = qUpperBound( | QList<TransactionRecord>::iterator upper = std::upper_bound( | ||||
cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); | cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); | ||||
int lowerIndex = (lower - cachedWallet.begin()); | int lowerIndex = (lower - cachedWallet.begin()); | ||||
int upperIndex = (upper - cachedWallet.begin()); | int upperIndex = (upper - cachedWallet.begin()); | ||||
bool inModel = (lower != upper); | bool inModel = (lower != upper); | ||||
if (status == CT_UPDATED) { | if (status == CT_UPDATED) { | ||||
// Not in model, but want to show, treat as new. | // Not in model, but want to show, treat as new. | ||||
if (showTransaction && !inModel) { | if (showTransaction && !inModel) { | ||||
▲ Show 20 Lines • Show All 669 Lines • Show Last 20 Lines |