mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
BlockTip struct created and connected to notifyHeaderTip and notifyBlockTip signals.
This commit is contained in:
@@ -36,6 +36,7 @@ struct bilingual_str;
|
||||
namespace interfaces {
|
||||
class Handler;
|
||||
class Wallet;
|
||||
struct BlockTip;
|
||||
|
||||
//! Top-level interface for a bitcoin node (bitcoind process).
|
||||
class Node
|
||||
@@ -253,12 +254,12 @@ public:
|
||||
|
||||
//! Register handler for block tip messages.
|
||||
using NotifyBlockTipFn =
|
||||
std::function<void(SynchronizationState, const uint256& block_hash, int height, int64_t block_time, double verification_progress)>;
|
||||
std::function<void(SynchronizationState, interfaces::BlockTip tip, double verification_progress)>;
|
||||
virtual std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) = 0;
|
||||
|
||||
//! Register handler for header tip messages.
|
||||
using NotifyHeaderTipFn =
|
||||
std::function<void(SynchronizationState, const uint256& block_hash, int height, int64_t block_time, double verification_progress)>;
|
||||
std::function<void(SynchronizationState, interfaces::BlockTip tip, double verification_progress)>;
|
||||
virtual std::unique_ptr<Handler> handleNotifyHeaderTip(NotifyHeaderTipFn fn) = 0;
|
||||
|
||||
//! Return pointer to internal chain interface, useful for testing.
|
||||
@@ -268,6 +269,13 @@ public:
|
||||
//! Return implementation of Node interface.
|
||||
std::unique_ptr<Node> MakeNode();
|
||||
|
||||
//! Block tip (could be a header or not, depends on the subscribed signal).
|
||||
struct BlockTip {
|
||||
int block_height;
|
||||
int64_t block_time;
|
||||
uint256 block_hash;
|
||||
};
|
||||
|
||||
} // namespace interfaces
|
||||
|
||||
#endif // BITCOIN_INTERFACES_NODE_H
|
||||
|
||||
Reference in New Issue
Block a user