From 9f13a10548bf77fb785a9c116234258275de6c04 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 22 Apr 2015 17:55:00 -0400 Subject: checkpoints: store mapCheckpoints in CCheckpointData rather than a pointer --- src/checkpoints.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/checkpoints.h') diff --git a/src/checkpoints.h b/src/checkpoints.h index 29dc5f83a9..9cccf4228a 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -20,7 +20,7 @@ namespace Checkpoints typedef std::map MapCheckpoints; struct CCheckpointData { - const MapCheckpoints *mapCheckpoints; + MapCheckpoints mapCheckpoints; int64_t nTimeLastCheckpoint; int64_t nTransactionsLastCheckpoint; double fTransactionsPerDay; -- cgit v1.2.3 From 11982d366df0301b8ceb6e9ec5bdc5a713be9ff0 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 22 Apr 2015 18:19:11 -0400 Subject: checkpoints: Decouple checkpoints from Params Pass checkpoint data in as necessary --- src/checkpoints.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/checkpoints.h') diff --git a/src/checkpoints.h b/src/checkpoints.h index 9cccf4228a..b6e2c5acaf 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -27,15 +27,15 @@ struct CCheckpointData { }; //! Returns true if block passes checkpoint checks -bool CheckBlock(int nHeight, const uint256& hash); +bool CheckBlock(const CCheckpointData& data, int nHeight, const uint256& hash); //! Return conservative estimate of total number of blocks, 0 if unknown -int GetTotalBlocksEstimate(); +int GetTotalBlocksEstimate(const CCheckpointData& data); //! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint -CBlockIndex* GetLastCheckpoint(); +CBlockIndex* GetLastCheckpoint(const CCheckpointData& data); -double GuessVerificationProgress(CBlockIndex* pindex, bool fSigchecks = true); +double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true); extern bool fEnabled; -- cgit v1.2.3 From a8cdaf5c962ff9018e2d8411f532eec7355f0623 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 22 Apr 2015 23:22:36 -0400 Subject: checkpoints: move the checkpoints enable boolean into main This pertains to app-state, so it doesn't make sense to handle inside the checkpoint functions. --- src/checkpoints.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/checkpoints.h') diff --git a/src/checkpoints.h b/src/checkpoints.h index b6e2c5acaf..07ed7032a8 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -37,8 +37,6 @@ CBlockIndex* GetLastCheckpoint(const CCheckpointData& data); double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true); -extern bool fEnabled; - } //namespace Checkpoints #endif // BITCOIN_CHECKPOINTS_H -- cgit v1.2.3