From 6e57c9e5b0f52efb74bf38586bfeffeef88b59ec Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Fri, 1 May 2026 13:02:35 +0100 Subject: [PATCH] fixing bad merge issue Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> --- src/libxrpl/protocol/STAmount.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libxrpl/protocol/STAmount.cpp b/src/libxrpl/protocol/STAmount.cpp index ef2468371e..4d7747db93 100644 --- a/src/libxrpl/protocol/STAmount.cpp +++ b/src/libxrpl/protocol/STAmount.cpp @@ -839,17 +839,22 @@ STAmount::canonicalize() Number const num(mIsNegative, mValue, mOffset, Number::unchecked{}); auto set = [&](auto const& val) { - mIsNegative = val.value() < 0; - mValue = mIsNegative ? -val.value() : val.value(); + auto const value = val.value(); + mIsNegative = value < 0; + mValue = mIsNegative ? -value : value; }; if (native()) { set(XRPAmount{num}); } - else + else if (mAsset.holds()) { set(MPTAmount{num}); } + else + { + Throw("Unknown integral asset type"); + } mOffset = 0; if (native() && mValue > cMaxNativeN)