mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
CAmountMap::operator! to check if empty
This commit is contained in:
parent
af726c7c36
commit
466b3d03f5
2 changed files with 9 additions and 0 deletions
|
|
@ -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<CAsset, CAmount>::const_iterator it = amount.begin(); it != amount.end(); ++it) {
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue