aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index e9d0a8cef..7dc3a42f0 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -162,7 +162,7 @@ static bool rest_headers(HTTPRequest* req,
CDataStream ssHeader(SER_NETWORK, PROTOCOL_VERSION);
const CChainParams& chainparams = Params();
BOOST_FOREACH(const CBlockIndex *pindex, headers) {
- ssHeader << pindex->GetBlockHeader(chainparams.GetConsensus());
+ ssHeader << pindex->GetBlockHeader(chainparams.GetConsensus(pindex->nHeight));
}
switch (rf) {
@@ -222,7 +222,7 @@ static bool rest_block(HTTPRequest* req,
if (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0)
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not available (pruned data)");
- if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus()))
+ if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus(pblockindex->nHeight)))
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
}
@@ -363,7 +363,7 @@ static bool rest_tx(HTTPRequest* req, const std::string& strURIPart)
CTransactionRef tx;
uint256 hashBlock = uint256();
- if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))
+ if (!GetTransaction(hash, tx, Params().GetConsensus(0), hashBlock, true))
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());