mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Disallow regular Clawback on Vault accounts
This commit is contained in:
@@ -347,6 +347,7 @@ enum TECcodes : TERUnderlyingType {
|
|||||||
tecWRONG_ASSET = 194,
|
tecWRONG_ASSET = 194,
|
||||||
tecLIMIT_EXCEEDED = 195,
|
tecLIMIT_EXCEEDED = 195,
|
||||||
tecINVALID_DOMAIN = 196,
|
tecINVALID_DOMAIN = 196,
|
||||||
|
tecVAULT_ACCOUNT = 197,
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ transResults()
|
|||||||
MAKE_ERROR(tecWRONG_ASSET, "Wrong asset given."),
|
MAKE_ERROR(tecWRONG_ASSET, "Wrong asset given."),
|
||||||
MAKE_ERROR(tecLIMIT_EXCEEDED, "Limit exceeded."),
|
MAKE_ERROR(tecLIMIT_EXCEEDED, "Limit exceeded."),
|
||||||
MAKE_ERROR(tecINVALID_DOMAIN, "Invalid permissioned domain."),
|
MAKE_ERROR(tecINVALID_DOMAIN, "Invalid permissioned domain."),
|
||||||
|
MAKE_ERROR(tecVAULT_ACCOUNT, "This operation is not allowed on a Vault Account."),
|
||||||
|
|
||||||
MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
|
MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
|
||||||
MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
|
MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
|
||||||
|
|||||||
@@ -210,6 +210,10 @@ Clawback::preclaim(PreclaimContext const& ctx)
|
|||||||
if (sleHolder->isFieldPresent(sfAMMID))
|
if (sleHolder->isFieldPresent(sfAMMID))
|
||||||
return tecAMM_ACCOUNT;
|
return tecAMM_ACCOUNT;
|
||||||
|
|
||||||
|
if (ctx.view.rules().enabled(featureSingleAssetVault) &&
|
||||||
|
sleHolder->isFieldPresent(sfVaultID))
|
||||||
|
return tecVAULT_ACCOUNT;
|
||||||
|
|
||||||
return std::visit(
|
return std::visit(
|
||||||
[&]<typename T>(T const&) {
|
[&]<typename T>(T const&) {
|
||||||
return preclaimHelper<T>(
|
return preclaimHelper<T>(
|
||||||
|
|||||||
Reference in New Issue
Block a user