Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiontablemodel.cpp
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | TransactionRecord *index(interfaces::Wallet &wallet, | ||||
// example, during a wallet rescan. | // example, during a wallet rescan. | ||||
// | // | ||||
// If a status update is needed (blocks came in since last check), | // If a status update is needed (blocks came in since last check), | ||||
// update the status of this transaction from the wallet. Otherwise, | // update the status of this transaction from the wallet. Otherwise, | ||||
// simply re-use the cached status. | // simply re-use the cached status. | ||||
interfaces::WalletTxStatus wtx; | interfaces::WalletTxStatus wtx; | ||||
int numBlocks; | int numBlocks; | ||||
int64_t block_time; | int64_t block_time; | ||||
if (rec->statusUpdateNeeded(cur_block_hash) && | if (!cur_block_hash.IsNull() && | ||||
rec->statusUpdateNeeded(cur_block_hash) && | |||||
wallet.tryGetTxStatus(rec->txid, wtx, numBlocks, block_time)) { | wallet.tryGetTxStatus(rec->txid, wtx, numBlocks, block_time)) { | ||||
rec->updateStatus(wtx, cur_block_hash, numBlocks, block_time); | rec->updateStatus(wtx, cur_block_hash, numBlocks, block_time); | ||||
} | } | ||||
return rec; | return rec; | ||||
} | } | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 468 Lines • ▼ Show 20 Lines | if (orientation == Qt::Horizontal) { | ||||
} | } | ||||
} | } | ||||
return QVariant(); | return QVariant(); | ||||
} | } | ||||
QModelIndex TransactionTableModel::index(int row, int column, | QModelIndex TransactionTableModel::index(int row, int column, | ||||
const QModelIndex &parent) const { | const QModelIndex &parent) const { | ||||
Q_UNUSED(parent); | Q_UNUSED(parent); | ||||
TransactionRecord *data = | TransactionRecord *data = priv->index( | ||||
priv->index(walletModel->wallet(), | walletModel->wallet(), walletModel->getLastBlockProcessed(), row); | ||||
walletModel->clientModel().getBestBlockHash(), row); | |||||
if (data) { | if (data) { | ||||
return createIndex(row, column, data); | return createIndex(row, column, data); | ||||
} | } | ||||
return QModelIndex(); | return QModelIndex(); | ||||
} | } | ||||
void TransactionTableModel::updateDisplayUnit() { | void TransactionTableModel::updateDisplayUnit() { | ||||
// emit dataChanged to update Amount column with the current unit | // emit dataChanged to update Amount column with the current unit | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |