From 730c6f3a5284e74c254a31a34f47040bc59cb2db Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 12 Oct 2012 20:19:36 -0700 Subject: [PATCH] Bugfix in STAmount::compare --- src/Amount.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Amount.cpp b/src/Amount.cpp index f564e071fd..7b9252e8fd 100644 --- a/src/Amount.cpp +++ b/src/Amount.cpp @@ -484,7 +484,11 @@ int STAmount::compare(const STAmount& a) const { // Compares the value of a to the value of this STAmount, amounts must be comparable if (mIsNegative != a.mIsNegative) return mIsNegative ? -1 : 1; - if (!mValue) return a.mValue ? 1 : 0; + if (!mValue) + { + if (a.mIsNegative) return 1; + return a.mValue ? -1 : 0; + } if (!a.mValue) return 1; if (mOffset > a.mOffset) return mIsNegative ? -1 : 1;