aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2022-08-12 17:29:52 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2022-08-29 08:10:35 -0400
commit355547334f7d08640ee1fa291227356d61145d1a (patch)
tree955cb7d78dd72167597499ec9f8ea9627af889dd /src/validation.h
parent03712dddfbb9fe0dc7a2ead53c65106189f5c803 (diff)
downloadbitcoin-355547334f7d08640ee1fa291227356d61145d1a.tar.xz
Track headers presync progress and log it
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h
index e5af65cde8..d3f293132f 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -868,6 +868,9 @@ private:
bool min_pow_checked) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
friend CChainState;
+ /** Most recent headers presync progress update, for rate-limiting. */
+ std::chrono::time_point<std::chrono::steady_clock> m_last_presync_update GUARDED_BY(::cs_main) {};
+
public:
using Options = kernel::ChainstateManagerOpts;
@@ -1046,6 +1049,12 @@ public:
/** Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks). */
std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev) const;
+ /** This is used by net_processing to report pre-synchronization progress of headers, as
+ * headers are not yet fed to validation during that time, but validation is (for now)
+ * responsible for logging and signalling through NotifyHeaderTip, so it needs this
+ * information. */
+ void ReportHeadersPresync(const arith_uint256& work, int64_t height, int64_t timestamp);
+
~ChainstateManager();
};