aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-12-18 23:03:16 -0800
committerMatt Corallo <git@bluematt.me>2017-01-04 15:56:08 -0500
commit80175472d1a9687da704c5180bda173596271b12 (patch)
treef9986f148b949adf707a01c352551fbf871c1ace /src/validation.cpp
parent7dac1e5e9e887f5f6ff146e812a05bd3bf281eae (diff)
Make CBlockIndex*es in net_processing const
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index ca1e5a713c..a6466334a1 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3030,12 +3030,14 @@ static bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state
}
// Exposed wrapper for AcceptBlockHeader
-bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex)
+bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, CValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex)
{
{
LOCK(cs_main);
for (const CBlockHeader& header : headers) {
- if (!AcceptBlockHeader(header, state, chainparams, ppindex)) {
+ // cast away the ppindex-returns-const CBlockIndex - we're just assigning it to a CBlockIndex*
+ // that we own and is updated non-const anyway
+ if (!AcceptBlockHeader(header, state, chainparams, const_cast<CBlockIndex**>(ppindex))) {
return false;
}
}