mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-30 09:40:16 +02:00
Add BlockAndHeaderTipInfo to the node interface/appInit
This commit is contained in:
parent
25e1d0bf41
commit
b354a1480a
@ -80,10 +80,10 @@ public:
|
|||||||
return AppInitBasicSetup() && AppInitParameterInteraction() && AppInitSanityChecks() &&
|
return AppInitBasicSetup() && AppInitParameterInteraction() && AppInitSanityChecks() &&
|
||||||
AppInitLockDataDirectory();
|
AppInitLockDataDirectory();
|
||||||
}
|
}
|
||||||
bool appInitMain() override
|
bool appInitMain(interfaces::BlockAndHeaderTipInfo* tip_info) override
|
||||||
{
|
{
|
||||||
m_context->chain = MakeChain(*m_context);
|
m_context->chain = MakeChain(*m_context);
|
||||||
return AppInitMain(m_context_ref, *m_context);
|
return AppInitMain(m_context_ref, *m_context, tip_info);
|
||||||
}
|
}
|
||||||
void appShutdown() override
|
void appShutdown() override
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,16 @@ class Handler;
|
|||||||
class Wallet;
|
class Wallet;
|
||||||
struct BlockTip;
|
struct BlockTip;
|
||||||
|
|
||||||
|
//! Block and header tip information
|
||||||
|
struct BlockAndHeaderTipInfo
|
||||||
|
{
|
||||||
|
int block_height;
|
||||||
|
int64_t block_time;
|
||||||
|
int header_height;
|
||||||
|
int64_t header_time;
|
||||||
|
double verification_progress;
|
||||||
|
};
|
||||||
|
|
||||||
//! Top-level interface for a bitcoin node (bitcoind process).
|
//! Top-level interface for a bitcoin node (bitcoind process).
|
||||||
class Node
|
class Node
|
||||||
{
|
{
|
||||||
@ -96,7 +106,7 @@ public:
|
|||||||
virtual bool baseInitialize() = 0;
|
virtual bool baseInitialize() = 0;
|
||||||
|
|
||||||
//! Start node.
|
//! Start node.
|
||||||
virtual bool appInitMain() = 0;
|
virtual bool appInitMain(interfaces::BlockAndHeaderTipInfo* tip_info = nullptr) = 0;
|
||||||
|
|
||||||
//! Stop node.
|
//! Stop node.
|
||||||
virtual void appShutdown() = 0;
|
virtual void appShutdown() = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user