Skip to content

Commit 9f13a10

Browse files
committed
checkpoints: store mapCheckpoints in CCheckpointData rather than a pointer
1 parent 8a10000 commit 9f13a10

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static Checkpoints::MapCheckpoints mapCheckpoints =
4343
(295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983"))
4444
;
4545
static const Checkpoints::CCheckpointData data = {
46-
&mapCheckpoints,
46+
mapCheckpoints,
4747
1397080064, // * UNIX timestamp of last checkpoint block
4848
36544669, // * total number of transactions between genesis and last checkpoint
4949
// (the tx=... number in the SetBestChain debug.log lines)
@@ -55,7 +55,7 @@ static Checkpoints::MapCheckpoints mapCheckpointsTestnet =
5555
( 546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70"))
5656
;
5757
static const Checkpoints::CCheckpointData dataTestnet = {
58-
&mapCheckpointsTestnet,
58+
mapCheckpointsTestnet,
5959
1337966069,
6060
1488,
6161
300
@@ -66,7 +66,7 @@ static Checkpoints::MapCheckpoints mapCheckpointsRegtest =
6666
( 0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"))
6767
;
6868
static const Checkpoints::CCheckpointData dataRegtest = {
69-
&mapCheckpointsRegtest,
69+
mapCheckpointsRegtest,
7070
0,
7171
0,
7272
0

src/checkpoints.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Checkpoints {
3030
if (!fEnabled)
3131
return true;
3232

33-
const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints;
33+
const MapCheckpoints& checkpoints = Params().Checkpoints().mapCheckpoints;
3434

3535
MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
3636
if (i == checkpoints.end()) return true;
@@ -74,7 +74,7 @@ namespace Checkpoints {
7474
if (!fEnabled)
7575
return 0;
7676

77-
const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints;
77+
const MapCheckpoints& checkpoints = Params().Checkpoints().mapCheckpoints;
7878

7979
return checkpoints.rbegin()->first;
8080
}
@@ -84,7 +84,7 @@ namespace Checkpoints {
8484
if (!fEnabled)
8585
return NULL;
8686

87-
const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints;
87+
const MapCheckpoints& checkpoints = Params().Checkpoints().mapCheckpoints;
8888

8989
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)
9090
{

src/checkpoints.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Checkpoints
2020
typedef std::map<int, uint256> MapCheckpoints;
2121

2222
struct CCheckpointData {
23-
const MapCheckpoints *mapCheckpoints;
23+
MapCheckpoints mapCheckpoints;
2424
int64_t nTimeLastCheckpoint;
2525
int64_t nTransactionsLastCheckpoint;
2626
double fTransactionsPerDay;

0 commit comments

Comments
 (0)