diff options
author | chriseth <c@ethdev.com> | 2015-05-22 15:33:57 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-22 22:12:40 +0800 |
commit | cd28fb8faa6009a53e1f127fb934d00f29da832d (patch) | |
tree | cba61f9d717749ea1929e7b308b6b3379eb395f2 /GasMeter.cpp | |
parent | d015945a1db28ba55ce674a73091742b781d2d9d (diff) | |
download | dexon-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.cpp | 5 |
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; |