mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
refactor: Pass SynchronizationState enum to GUI
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
@@ -308,16 +308,16 @@ public:
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.NotifyBlockTip_connect([fn](bool initial_download, const CBlockIndex* block) {
|
||||
fn(initial_download, block->nHeight, block->GetBlockTime(),
|
||||
return MakeHandler(::uiInterface.NotifyBlockTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
|
||||
fn(sync_state, block->nHeight, block->GetBlockTime(),
|
||||
GuessVerificationProgress(Params().TxData(), block));
|
||||
}));
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyHeaderTip(NotifyHeaderTipFn fn) override
|
||||
{
|
||||
return MakeHandler(
|
||||
::uiInterface.NotifyHeaderTip_connect([fn](bool initial_download, const CBlockIndex* block) {
|
||||
fn(initial_download, block->nHeight, block->GetBlockTime(),
|
||||
::uiInterface.NotifyHeaderTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
|
||||
fn(sync_state, block->nHeight, block->GetBlockTime(),
|
||||
/* verification progress is unused when a header was received */ 0);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class Coin;
|
||||
class RPCTimerInterface;
|
||||
class UniValue;
|
||||
class proxyType;
|
||||
enum class SynchronizationState;
|
||||
enum class WalletCreationStatus;
|
||||
struct CNodeStateStats;
|
||||
struct NodeContext;
|
||||
@@ -249,12 +250,12 @@ public:
|
||||
|
||||
//! Register handler for block tip messages.
|
||||
using NotifyBlockTipFn =
|
||||
std::function<void(bool initial_download, int height, int64_t block_time, double verification_progress)>;
|
||||
std::function<void(SynchronizationState, int height, int64_t block_time, double verification_progress)>;
|
||||
virtual std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) = 0;
|
||||
|
||||
//! Register handler for header tip messages.
|
||||
using NotifyHeaderTipFn =
|
||||
std::function<void(bool initial_download, int height, int64_t block_time, double verification_progress)>;
|
||||
std::function<void(SynchronizationState, int height, int64_t block_time, double verification_progress)>;
|
||||
virtual std::unique_ptr<Handler> handleNotifyHeaderTip(NotifyHeaderTipFn fn) = 0;
|
||||
|
||||
//! Return pointer to internal chain interface, useful for testing.
|
||||
|
||||
Reference in New Issue
Block a user