Skip to content

Commit

Permalink
Fix CFT related amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Oct 11, 2023
1 parent 1d97251 commit b024e28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/ripple/app/paths/impl/AmountSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,23 @@ template <>
inline IOUAmount&
get<IOUAmount>(EitherAmount& amt)
{
// assert(!amt.native && !amt.cft);
assert(!amt.native);
assert(!amt.native && !amt.is_cft);
return amt.iou;
}

template <>
inline XRPAmount&
get<XRPAmount>(EitherAmount& amt)
{
assert(amt.native && !amt.cft);
assert(amt.native && !amt.is_cft);
return amt.xrp;
}

template <>
inline CFTAmount&
get<CFTAmount>(EitherAmount& amt)
{
assert(amt.cft && !amt.native);
assert(amt.is_cft && !amt.native);
return amt.cft;
}

Expand All @@ -177,8 +176,7 @@ template <>
inline IOUAmount const&
get<IOUAmount>(EitherAmount const& amt)
{
// assert(!amt.native && !amt.cft);
assert(!amt.native);
assert(!amt.native && !amt.is_cft);
return amt.iou;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/STAmount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ getSNValue(STAmount const& amount)
static bool
areComparable(STAmount const& v1, STAmount const& v2)
{
return (v1.native() == v2.native() || v1.cft() == v2.cft()) &&
return (v1.native() == v2.native() || v1.isCFT() == v2.isCFT()) &&
v1.issue().currency == v2.issue().currency;
}

Expand Down

0 comments on commit b024e28

Please sign in to comment.