aboutsummaryrefslogtreecommitdiffstats
path: root/GasMeter.cpp
diff options
context:
space:
mode:
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;