WIP: Get the block time and sort it.

This commit is contained in:
Just Wonder 2020-04-05 18:28:06 -07:00
parent e044fdae22
commit ad16d76725
2 changed files with 6 additions and 1 deletions

View File

@ -134,6 +134,7 @@ void KevaDialog::on_showContent_clicked()
std::vector<KevaEntry> vKevaEntries;
model->getKevaEntries(vKevaEntries, ValtypeToString(namespaceVal));
model->getKevaTableModel()->setKeva(std::move(vKevaEntries));
model->getKevaTableModel()->sort(KevaTableModel::Date, Qt::DescendingOrder);
}
void KevaDialog::on_recentRequestsView_doubleClicked(const QModelIndex &index)

View File

@ -768,7 +768,11 @@ void WalletModel::getKevaEntries(std::vector<KevaEntry>& vKevaEntries, std::stri
entry.value = ValtypeToString(data.getValue());
entry.block = data.getHeight();
// TODO: figure out how to get the date time from block.
entry.date = QDateTime::currentDateTime();
CBlockIndex* pblockindex = chainActive[entry.block];
if (pblockindex) {
entry.date.setTime_t(pblockindex->nTime);
}
vKevaEntries.push_back(std::move(entry));
}
}