fix: trust line RPC no ripple flag (#5345)

The Trustline RPC `no_ripple` flag gets set depending on `lsfDefaultRipple` flag, which is not a flag of a trustline but of the account root. The `lsfDefaultRipple` flag does not provide any insight if this particular trust line has `lsfLowNoRipple` or `lsfHighNoRipple` flag set, so it should not be used here at all. This change simplifies the logic.
This commit is contained in:
Vlad
2025-03-18 13:03:03 +00:00
committed by GitHub
parent a7fb8ae915
commit bf504912a4
3 changed files with 8 additions and 10 deletions

View File

@@ -250,6 +250,10 @@ public:
gw1.human() + R"("})");
BEAST_EXPECT(lines[jss::result][jss::lines].isArray());
BEAST_EXPECT(lines[jss::result][jss::lines].size() == 26);
// Check no ripple is not set for trustlines between alice and gw1
auto const& line = lines[jss::result][jss::lines][0u];
BEAST_EXPECT(!line[jss::no_ripple].isMember(jss::no_ripple));
}
{
// Use a malformed peer.

View File

@@ -101,12 +101,6 @@ public:
return mFlags & (!mViewLowest ? lsfLowAuth : lsfHighAuth);
}
bool
getDefaultRipple() const
{
return mFlags & lsfDefaultRipple;
}
bool
getNoRipple() const
{

View File

@@ -54,10 +54,10 @@ addLine(Json::Value& jsonLines, RPCTrustLine const& line)
jPeer[jss::authorized] = true;
if (line.getAuthPeer())
jPeer[jss::peer_authorized] = true;
if (line.getNoRipple() || !line.getDefaultRipple())
jPeer[jss::no_ripple] = line.getNoRipple();
if (line.getNoRipplePeer() || !line.getDefaultRipple())
jPeer[jss::no_ripple_peer] = line.getNoRipplePeer();
if (line.getNoRipple())
jPeer[jss::no_ripple] = true;
if (line.getNoRipplePeer())
jPeer[jss::no_ripple_peer] = true;
if (line.getFreeze())
jPeer[jss::freeze] = true;
if (line.getFreezePeer())