Browse Source

style

cl-refactor
CJentzsch 10 years ago
parent
commit
d968959ad0
  1. 12
      libethereum/Client.cpp

12
libethereum/Client.cpp

@ -82,8 +82,8 @@ void BasicGasPricer::update(BlockChain const& _bc)
h256 p = _bc.currentHash();
m_gasPerBlock = _bc.info(p).gasLimit;
map<u256, unsigned> dist;
unsigned total = 0;
map<u256, u256> dist;
u256 total = 0;
// make gasPrice versus gasUsed distribution for the last 1000 blocks
while (c < 1000 && p)
@ -98,9 +98,9 @@ void BasicGasPricer::update(BlockChain const& _bc)
for (auto const& tr: r[1])
{
Transaction tx(tr.data(), CheckTransaction::None);
auto gu = brs.receipts[i].gasUsed();
dist[tx.gasPrice()] += (unsigned)gu;
total += (unsigned)gu;
u256 gu = brs.receipts[i].gasUsed();
dist[tx.gasPrice()] += gu;
total += gu;
i++;
}
}
@ -130,7 +130,7 @@ void BasicGasPricer::update(BlockChain const& _bc)
// calc octiles normalized to gaussian distribution
boost::math::normal gauss(4, normalizedSd ? normalizedSd : 1);
for (int i = 1; i < 8; i++)
m_octiles[i] = mean / 4000 * int(boost::math::quantile(gauss, (double)i / 8) * 1000);
m_octiles[i] = mean / 4000 * int(boost::math::quantile(gauss, i / 8.0) * 1000);
m_octiles[8] = dist.rbegin()->first;
}

Loading…
Cancel
Save