diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2023-12-19 10:30:14 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2024-01-15 10:28:20 -0300 |
commit | 97df4e38879d2644aeec34c1eef241fed627333e (patch) | |
tree | e959873dd17fbc306f8db99a078252be745073d1 /src/net_processing.h | |
parent | dd391944dc2d4e7dda9439647e603b41ba751b78 (diff) |
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.
Diffstat (limited to 'src/net_processing.h')
-rw-r--r-- | src/net_processing.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.h b/src/net_processing.h index afdef00067..f3aa2c84c6 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -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; |