From 363a3b359a6d2e2bdc6d6322a07ad5f8271be1c4 Mon Sep 17 00:00:00 2001 From: Aiwe Date: Wed, 5 Jan 2022 12:39:08 +0200 Subject: [PATCH] Show date and time in found block message --- src/Miner.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Miner.cpp b/src/Miner.cpp index d7cc93e51..c096d6b08 100644 --- a/src/Miner.cpp +++ b/src/Miner.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -221,8 +222,11 @@ namespace WalletGui m_threads.push_back(std::thread(std::bind(&Miner::worker_thread, this, i))); } + QDateTime date = QDateTime::currentDateTime(); + QString formattedTime = date.toString("dd.MM.yyyy hh:mm:ss"); + m_logger(Logging::INFO) << "Mining has started with " << threads_count << " thread(s), at difficulty " << m_diffic << " good luck!"; - Q_EMIT minerMessageSignal(QString("Mining has started with %1 thread(s) at difficulty %2, good luck!").arg(threads_count).arg(m_diffic)); + Q_EMIT minerMessageSignal(QString("%1 Mining has started with %2 thread(s) at difficulty %3, good luck!").arg(formattedTime).arg(threads_count).arg(m_diffic)); return true; } @@ -388,8 +392,11 @@ namespace WalletGui } uint32_t bh = boost::get(b.baseTransaction.inputs[0]).blockIndex; + QDateTime date = QDateTime::currentDateTime(); + QString formattedTime = date.toString("dd.MM.yyyy hh:mm:ss"); + m_logger(Logging::INFO) << "Found block " << Common::podToHex(id) << " at height " << bh << " for difficulty: " << local_diff << ", POW " << Common::podToHex(pow); - Q_EMIT minerMessageSignal(QString("Found block %1 at height %2 for difficulty %3, POW %4").arg(QString::fromStdString(Common::podToHex(id))).arg(bh).arg(local_diff).arg(QString::fromStdString(Common::podToHex(pow)))); + Q_EMIT minerMessageSignal(QString("%1 Found block %2 at height %3 for difficulty %4, POW %5").arg(formattedTime).arg(QString::fromStdString(Common::podToHex(id))).arg(bh).arg(local_diff).arg(QString::fromStdString(Common::podToHex(pow)))); if(!NodeAdapter::instance().handleBlockFound(b)) { m_logger(Logging::ERROR) << "Failed to submit block";