#include <boost/filesystem.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
-#include <ostream>
using namespace json_spirit;
using namespace std;
double dStakeKernelsTriedAvg = 0;
int nStakesHandled = 0, nStakesTime = 0;
- CBlockIndex* pindex = pindexBest;;
+ CBlockIndex* pindex = pindexBest;
CBlockIndex* pindexPrevStake = NULL;
while (pindex && nStakesHandled < nPoSInterval)
Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPrintTransactionDetail)
{
Object result;
- result.push_back(Pair("hash", block.GetHash().GetHex()));
+ result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex()));
CMerkleTx txGen(block.vtx[0]);
txGen.SetMerkleBranch(&block);
result.push_back(Pair("confirmations", (int)txGen.GetDepthInMainChain()));
result.push_back(Pair("modifier", strprintf("%016" PRIx64, blockindex->nStakeModifier)));
result.push_back(Pair("modifierchecksum", strprintf("%08x", blockindex->nStakeModifierChecksum)));
Array txinfo;
- BOOST_FOREACH (const CTransaction& tx, block.vtx)
+ for (const CTransaction& tx : block.vtx)
{
if (fPrintTransactionDetail)
{
mempool.queryHashes(vtxid);
Array a;
- BOOST_FOREACH(const uint256& hash, vtxid)
+ for (const uint256& hash : vtxid)
a.push_back(hash.ToString());
return a;