chainparams: move CCheckpointData into chainparams.h

This unties CChainParams from its dependency on checkpoints. Instead, now it
only depends on the raw checkpoint data.
This commit is contained in:
Cory Fields
2015-06-05 15:36:34 -04:00
committed by Jack Grigg
parent a97308c5d4
commit 47b71cec5d
4 changed files with 15 additions and 15 deletions

View File

@@ -7,7 +7,6 @@
#define BITCOIN_CHAINPARAMS_H
#include "chainparamsbase.h"
#include "checkpoints.h"
#include "consensus/params.h"
#include "primitives/block.h"
#include "protocol.h"
@@ -24,6 +23,14 @@ struct SeedSpec6 {
uint16_t port;
};
typedef std::map<int, uint256> MapCheckpoints;
struct CCheckpointData {
MapCheckpoints mapCheckpoints;
int64_t nTimeLastCheckpoint;
int64_t nTransactionsLastCheckpoint;
double fTransactionsPerDay;
};
/**
* CChainParams defines various tweakable parameters of a given instance of the
@@ -75,7 +82,7 @@ public:
const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; }
const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
const Checkpoints::CCheckpointData& Checkpoints() const { return checkpointData; }
const CCheckpointData& Checkpoints() const { return checkpointData; }
/** Return the founder's reward address and script for a given block height */
std::string GetFoundersRewardAddressAtHeight(int height) const;
CScript GetFoundersRewardScriptAtHeight(int height) const;
@@ -105,7 +112,7 @@ protected:
bool fRequireStandard = false;
bool fMineBlocksOnDemand = false;
bool fTestnetToBeDeprecatedFieldRPC = false;
Checkpoints::CCheckpointData checkpointData;
CCheckpointData checkpointData;
std::vector<std::string> vFoundersRewardAddress;
};