diff --git a/src/asset.cpp b/src/asset.cpp index 9831c7ea5c..70c5a91154 100644 --- a/src/asset.cpp +++ b/src/asset.cpp @@ -121,6 +121,14 @@ bool operator!=(const CAmountMap& a, const CAmountMap& b) return !(a == b); } +bool operator!(const CAmountMap& a) +{ + for (const auto& it : a) { + if (it.second) return false; + } + return true; +} + bool hasNegativeValue(const CAmountMap& amount) { for(std::map::const_iterator it = amount.begin(); it != amount.end(); ++it) { diff --git a/src/asset.h b/src/asset.h index 381df84c4f..483170df32 100644 --- a/src/asset.h +++ b/src/asset.h @@ -93,6 +93,7 @@ bool operator>(const CAmountMap& a, const CAmountMap& b); bool operator>=(const CAmountMap& a, const CAmountMap& b); bool operator==(const CAmountMap& a, const CAmountMap& b); bool operator!=(const CAmountMap& a, const CAmountMap& b); +bool operator!(const CAmountMap& a); // Check if all values are 0 inline bool MoneyRange(const CAmountMap& mapValue) { for(CAmountMap::const_iterator it = mapValue.begin(); it != mapValue.end(); it++) {