mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
net: store best block tip time inside PeerManager
And implement 'ApproximateBestBlockDepth()' to estimate the distance, in blocks, between the best-known block and the network chain tip. Utilizing the best-block time and the chainparams blocks spacing to approximate it.
This commit is contained in:
@@ -92,8 +92,8 @@ public:
|
||||
/** Send ping message to all peers */
|
||||
virtual void SendPings() = 0;
|
||||
|
||||
/** Set the best height */
|
||||
virtual void SetBestHeight(int height) = 0;
|
||||
/** Set the height of the best block and its time (seconds since epoch). */
|
||||
virtual void SetBestBlock(int height, std::chrono::seconds time) = 0;
|
||||
|
||||
/* Public for unit testing. */
|
||||
virtual void UnitTestMisbehaving(NodeId peer_id, int howmuch) = 0;
|
||||
|
||||
Reference in New Issue
Block a user