mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
kernel: Add progress method to notifications
This commit is part of the libbitcoinkernel project and seeks to remove the ChainstateManager's and, more generally, the kernel library's dependency on interface_ui with options methods in this and the following few commits. By removing interface_ui from the kernel library, its dependency on boost is reduced to just boost::multi_index.
This commit is contained in:
@@ -253,7 +253,7 @@ ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager& chainman, const C
|
||||
"Only rebuild the block database if you are sure that your computer's date and time are correct")};
|
||||
}
|
||||
|
||||
VerifyDBResult result = CVerifyDB().VerifyDB(
|
||||
VerifyDBResult result = CVerifyDB(chainman.GetNotifications()).VerifyDB(
|
||||
*chainstate, chainman.GetConsensus(), chainstate->CoinsDB(),
|
||||
options.check_level,
|
||||
options.check_blocks);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <node/kernel_notifications.h>
|
||||
|
||||
#include <node/interface_ui.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
namespace node {
|
||||
|
||||
@@ -18,4 +19,9 @@ void KernelNotifications::headerTip(SynchronizationState state, int64_t height,
|
||||
uiInterface.NotifyHeaderTip(state, height, timestamp, presync);
|
||||
}
|
||||
|
||||
void KernelNotifications::progress(const bilingual_str& title, int progress_percent, bool resume_possible)
|
||||
{
|
||||
uiInterface.ShowProgress(title.translated, progress_percent, resume_possible);
|
||||
}
|
||||
|
||||
} // namespace node
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
#include <kernel/notifications_interface.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
class CBlockIndex;
|
||||
enum class SynchronizationState;
|
||||
struct bilingual_str;
|
||||
|
||||
namespace node {
|
||||
class KernelNotifications : public kernel::Notifications
|
||||
@@ -19,6 +21,8 @@ public:
|
||||
void blockTip(SynchronizationState state, CBlockIndex& index) override;
|
||||
|
||||
void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) override;
|
||||
|
||||
void progress(const bilingual_str& title, int progress_percent, bool resume_possible) override;
|
||||
};
|
||||
} // namespace node
|
||||
|
||||
|
||||
Reference in New Issue
Block a user