aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-12-28 15:04:08 +0000
committerRoss Nicoll <[email protected]>2018-09-19 19:24:06 +0100
commit1be681a1b97b686f838af90682a57f2030d26015 (patch)
treeb2795e4a1d35004dbfd84d49b07bc54413a2a9e1 /src/rest.cpp
parentChange BIP65/66 enforcement to match Dogecoin (#1403) (diff)
downloaddiscoin-1be681a1b97b686f838af90682a57f2030d26015.tar.xz
discoin-1be681a1b97b686f838af90682a57f2030d26015.zip
Modify chain consensus parameters to be height aware (#1396)
* Modify chain consensus parameters to be height aware * Correct implementation of simplified rewards in parameters * Correct max money * Use base block version in IsSuperMajority() instead of full version * Correct mining of blocks in AuxPoW tests * Add in missing pre-AuxPoW consensus checks
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());