mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Added best block hash to the NotifyHeaderTip and NotifyBlockTip signals.
[ClientModel] best header/block hash cached.
This commit is contained in:
@@ -176,7 +176,7 @@ public:
|
||||
return cachedWallet.size();
|
||||
}
|
||||
|
||||
TransactionRecord *index(interfaces::Wallet& wallet, const int cur_num_blocks, const int idx)
|
||||
TransactionRecord* index(interfaces::Wallet& wallet, const uint256& cur_block_hash, const int idx)
|
||||
{
|
||||
if(idx >= 0 && idx < cachedWallet.size())
|
||||
{
|
||||
@@ -192,8 +192,8 @@ public:
|
||||
interfaces::WalletTxStatus wtx;
|
||||
int numBlocks;
|
||||
int64_t block_time;
|
||||
if (rec->statusUpdateNeeded(cur_num_blocks) && wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, block_time)) {
|
||||
rec->updateStatus(wtx, numBlocks, block_time);
|
||||
if (rec->statusUpdateNeeded(cur_block_hash) && wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, block_time)) {
|
||||
rec->updateStatus(wtx, cur_block_hash, numBlocks, block_time);
|
||||
}
|
||||
return rec;
|
||||
}
|
||||
@@ -664,7 +664,7 @@ QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientat
|
||||
QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
TransactionRecord *data = priv->index(walletModel->wallet(), walletModel->getNumBlocks(), row);
|
||||
TransactionRecord* data = priv->index(walletModel->wallet(), walletModel->clientModel().getBestBlockHash(), row);
|
||||
if(data)
|
||||
{
|
||||
return createIndex(row, column, data);
|
||||
|
||||
Reference in New Issue
Block a user