aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-05-18 12:01:56 -0400
committerCarl Dong <contact@carldong.me>2022-05-20 11:57:54 -0400
commit53494bc7392591336e09d095f1fc38d63d566abf (patch)
tree1c0f673f26fc3c00509a40f263c69d7a002431e0 /src/validation.h
parent04c31c1295eb4ecd42afd54b8e353cbda93d83f0 (diff)
downloadbitcoin-53494bc7392591336e09d095f1fc38d63d566abf.tar.xz
validation: Have ChainstateManager own m_chainparams
We want m_chainparams to be alive for the duration of ChainstateManager's lifetime since ChainstateManager's behaviour depends on m_chainparams. We could allow for a std::shared_ptr to be passed in as m_chainparams, but that complicates things further. Given that CChainParams is not an entity class or struct, we can just copy it and have ChainstateManager own it.
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.h b/src/validation.h
index 6f4404e7ec..31dd089005 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -836,7 +836,7 @@ private:
CBlockIndex* m_best_invalid GUARDED_BY(::cs_main){nullptr};
- const CChainParams& m_chainparams;
+ const CChainParams m_chainparams;
const std::function<int64_t()> m_adjusted_time_callback;