Browse Source

WIP: Get the block time and sort it.

kevaview
Just Wonder 5 years ago
parent
commit
ad16d76725
  1. 1
      src/qt/kevadialog.cpp
  2. 6
      src/qt/walletmodel.cpp

1
src/qt/kevadialog.cpp

@ -134,6 +134,7 @@ void KevaDialog::on_showContent_clicked() @@ -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)

6
src/qt/walletmodel.cpp

@ -768,7 +768,11 @@ void WalletModel::getKevaEntries(std::vector<KevaEntry>& vKevaEntries, std::stri @@ -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));
}
}

Loading…
Cancel
Save