mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
fix: add allowClawback flag for account_info (#4590)
* Update the `account_info` API so that the `allowClawback` flag is
included in the response.
* The proposed `Clawback` amendement added an `allowClawback` flag in
the `AccountRoot` object.
* In the API response, under `account_flags`, there is now an
`allowClawback` field with a boolean (`true` or `false`) value.
* For reference, the XLS-39 Clawback implementation can be found in
#4553
Fix #4588
This commit is contained in:
@@ -96,6 +96,9 @@ doAccountInfo(RPC::JsonContext& context)
|
||||
{"disallowIncomingPayChan", lsfDisallowIncomingPayChan},
|
||||
{"disallowIncomingTrustline", lsfDisallowIncomingTrustline}}};
|
||||
|
||||
static constexpr std::pair<std::string_view, LedgerSpecificFlags>
|
||||
allowClawbackFlag{"allowClawback", lsfAllowClawback};
|
||||
|
||||
auto const sleAccepted = ledger->read(keylet::account(accountID));
|
||||
if (sleAccepted)
|
||||
{
|
||||
@@ -123,6 +126,11 @@ doAccountInfo(RPC::JsonContext& context)
|
||||
for (auto const& lsf : disallowIncomingFlags)
|
||||
acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
|
||||
}
|
||||
|
||||
if (ledger->rules().enabled(featureClawback))
|
||||
acctFlags[allowClawbackFlag.first.data()] =
|
||||
sleAccepted->isFlag(allowClawbackFlag.second);
|
||||
|
||||
result[jss::account_flags] = std::move(acctFlags);
|
||||
|
||||
// The document states that signer_lists is a bool, however
|
||||
|
||||
Reference in New Issue
Block a user