aboutsummaryrefslogtreecommitdiffstats
path: root/GasMeter.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-05-22 15:33:57 +0800
committerchriseth <c@ethdev.com>2015-05-22 22:12:40 +0800
commitcd28fb8faa6009a53e1f127fb934d00f29da832d (patch)
treecba61f9d717749ea1929e7b308b6b3379eb395f2 /GasMeter.cpp
parentd015945a1db28ba55ce674a73091742b781d2d9d (diff)
downloaddexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.tar
dexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.tar.gz
dexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.tar.bz2
dexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.tar.lz
dexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.tar.xz
dexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.tar.zst
dexon-solidity-cd28fb8faa6009a53e1f127fb934d00f29da832d.zip
Path gas meter.
Diffstat (limited to 'GasMeter.cpp')
-rw-r--r--GasMeter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/GasMeter.cpp b/GasMeter.cpp
index a8dc4dd5..3749e635 100644
--- a/GasMeter.cpp
+++ b/GasMeter.cpp
@@ -29,12 +29,13 @@ using namespace dev::eth;
GasMeter::GasConsumption& GasMeter::GasConsumption::operator+=(GasConsumption const& _other)
{
- isInfinite = isInfinite || _other.isInfinite;
+ if (_other.isInfinite && !isInfinite)
+ *this = infinite();
if (isInfinite)
return *this;
bigint v = bigint(value) + _other.value;
if (v > std::numeric_limits<u256>::max())
- isInfinite = true;
+ *this = infinite();
else
value = u256(v);
return *this;