Skip to content

Commit b354a14

Browse files
committed
Add BlockAndHeaderTipInfo to the node interface/appInit
1 parent 25e1d0b commit b354a14

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/interfaces/node.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ class NodeImpl : public Node
8080
return AppInitBasicSetup() && AppInitParameterInteraction() && AppInitSanityChecks() &&
8181
AppInitLockDataDirectory();
8282
}
83-
bool appInitMain() override
83+
bool appInitMain(interfaces::BlockAndHeaderTipInfo* tip_info) override
8484
{
8585
m_context->chain = MakeChain(*m_context);
86-
return AppInitMain(m_context_ref, *m_context);
86+
return AppInitMain(m_context_ref, *m_context, tip_info);
8787
}
8888
void appShutdown() override
8989
{

src/interfaces/node.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ class Handler;
3939
class Wallet;
4040
struct BlockTip;
4141

42+
//! Block and header tip information
43+
struct BlockAndHeaderTipInfo
44+
{
45+
int block_height;
46+
int64_t block_time;
47+
int header_height;
48+
int64_t header_time;
49+
double verification_progress;
50+
};
51+
4252
//! Top-level interface for a bitcoin node (bitcoind process).
4353
class Node
4454
{
@@ -96,7 +106,7 @@ class Node
96106
virtual bool baseInitialize() = 0;
97107

98108
//! Start node.
99-
virtual bool appInitMain() = 0;
109+
virtual bool appInitMain(interfaces::BlockAndHeaderTipInfo* tip_info = nullptr) = 0;
100110

101111
//! Stop node.
102112
virtual void appShutdown() = 0;

0 commit comments

Comments
 (0)