diff --git a/eth/main.cpp b/eth/main.cpp index b41c7a1ca..968cbf4c5 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -1141,7 +1141,7 @@ int main(int argc, char** argv) { gasPricer->setRefBlockFees(u256(blockFees * 1000)); } - catch(Overflow const& _e) + catch (Overflow const& _e) { cout << boost::diagnostic_information(_e); } @@ -1152,14 +1152,14 @@ int main(int argc, char** argv) { iss >> etherPrice; if (etherPrice == 0) - cout << "ether price can not be set to zero" << endl; + cout << "ether price cannot be set to zero" << endl; else { try { gasPricer->setRefPrice(u256(double(ether / 1000) / etherPrice)); } - catch(Overflow const& _e) + catch (Overflow const& _e) { cout << boost::diagnostic_information(_e); } diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 897c79b6c..a7f2d0ad2 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -82,8 +82,8 @@ void BasicGasPricer::update(BlockChain const& _bc) h256 p = _bc.currentHash(); m_gasPerBlock = _bc.info(p).gasLimit; - map dist; - unsigned total = 0; + map 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++; } } @@ -129,8 +129,8 @@ 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); + for (int i = 1; i < 8; i++) + m_octiles[i] = mean / 4000 * int(boost::math::quantile(gauss, i / 8.0) * 1000); m_octiles[8] = dist.rbegin()->first; } diff --git a/neth/main.cpp b/neth/main.cpp index e4ab18466..066177b2f 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -722,7 +722,7 @@ int main(int argc, char** argv) { gasPricer->setRefBlockFees(u256(blockFees * 1000)); } - catch(Overflow const& _e) + catch (Overflow const& _e) { cout << boost::diagnostic_information(_e); } @@ -733,14 +733,14 @@ int main(int argc, char** argv) { iss >> etherPrice; if (etherPrice == 0) - cout << "ether price can not be set to zero" << endl; + cout << "ether price cannot be set to zero" << endl; else { try { gasPricer->setRefPrice(u256(double(ether / 1000) / etherPrice)); } - catch(Overflow const& _e) + catch (Overflow const& _e) { cout << boost::diagnostic_information(_e); }