aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2014-09-04 02:01:10 +0200
committerPieter Wuille <[email protected]>2014-09-04 02:01:10 +0200
commita0dbe433bdb3f22be639fbb675c371277fba6d80 (patch)
tree07510ed5abf653fa6562bc6eb0276455f2419a69 /src
parentMerge pull request #4808 (diff)
downloaddiscoin-a0dbe433bdb3f22be639fbb675c371277fba6d80.tar.xz
discoin-a0dbe433bdb3f22be639fbb675c371277fba6d80.zip
checkpoints.cpp depends on main, it can use mapBlockIndex directly
Diffstat (limited to 'src')
-rw-r--r--src/checkpoints.cpp2
-rw-r--r--src/checkpoints.h2
-rw-r--r--src/main.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp
index 717f0b90f..343d5251f 100644
--- a/src/checkpoints.cpp
+++ b/src/checkpoints.cpp
@@ -146,7 +146,7 @@ namespace Checkpoints {
return checkpoints.rbegin()->first;
}
- CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
+ CBlockIndex* GetLastCheckpoint()
{
if (!fEnabled)
return NULL;
diff --git a/src/checkpoints.h b/src/checkpoints.h
index 52cdc3555..6d3f2d493 100644
--- a/src/checkpoints.h
+++ b/src/checkpoints.h
@@ -22,7 +22,7 @@ namespace Checkpoints {
int GetTotalBlocksEstimate();
// Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
- CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex);
+ CBlockIndex* GetLastCheckpoint();
double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks = true);
diff --git a/src/main.cpp b/src/main.cpp
index 4aebdadd3..a024461e2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2302,7 +2302,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex
return state.Invalid(error("AcceptBlock() : block is marked invalid"), 0, "duplicate");
}
- CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex);
+ CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint();
if (pcheckpoint && block.hashPrevBlock != (chainActive.Tip() ? chainActive.Tip()->GetBlockHash() : uint256(0)))
{
// Extra checks to prevent "fill up memory by spamming with bogus blocks"
@@ -2345,7 +2345,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex
REJECT_CHECKPOINT, "checkpoint mismatch");
// Don't accept any forks from the main chain prior to last checkpoint
- CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex);
+ CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint();
if (pcheckpoint && nHeight < pcheckpoint->nHeight)
return state.DoS(100, error("AcceptBlock() : forked chain older than last checkpoint (height %d)", nHeight));
@@ -3286,7 +3286,7 @@ void static ProcessGetData(CNode* pfrom)
// If the requested block is at a height below our last
// checkpoint, only serve it if it's in the checkpointed chain
int nHeight = mi->second->nHeight;
- CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex);
+ CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint();
if (pcheckpoint && nHeight < pcheckpoint->nHeight) {
if (!chainActive.Contains(mi->second))
{