diff --git a/include/xrpl/protocol/STMPTAmount.h b/include/xrpl/protocol/STMPTAmount.h index 347234ab101..87ddd96e856 100644 --- a/include/xrpl/protocol/STMPTAmount.h +++ b/include/xrpl/protocol/STMPTAmount.h @@ -94,20 +94,20 @@ class STMPTAmount final : public MPTAmount, signum() const noexcept; bool - operator==(STMPTAmount const& rhs); + operator==(STMPTAmount const& rhs) const; bool - operator!=(STMPTAmount const& rhs); + operator!=(STMPTAmount const& rhs) const; }; inline bool -STMPTAmount::operator==(STMPTAmount const& rhs) +STMPTAmount::operator==(STMPTAmount const& rhs) const { return value_ == rhs.value_ && issue_ == rhs.issue_; } inline bool -STMPTAmount::operator!=(STMPTAmount const& rhs) +STMPTAmount::operator!=(STMPTAmount const& rhs) const { return !operator==(rhs); } diff --git a/src/libxrpl/protocol/STMPTAmount.cpp b/src/libxrpl/protocol/STMPTAmount.cpp index b1c5a782c66..f2c671862c8 100644 --- a/src/libxrpl/protocol/STMPTAmount.cpp +++ b/src/libxrpl/protocol/STMPTAmount.cpp @@ -108,7 +108,7 @@ bool STMPTAmount::isEquivalent(const STBase& t) const { const STMPTAmount* v = dynamic_cast(&t); - return v && (*v == *this); + return v && operator == (*v); } bool