mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-02 16:26:48 +00:00
Fix skip isVaultPseudoAccountFrozen() for non-vault shares.
This commit is contained in:
@@ -108,7 +108,8 @@ enforceMPTokenAuthorization(
|
||||
MPTID const& mptIssuanceID,
|
||||
AccountID const& account,
|
||||
XRPAmount const& priorBalance,
|
||||
beast::Journal j);
|
||||
beast::Journal j,
|
||||
std::uint32_t flags = 0);
|
||||
|
||||
/** Check if the destination account is allowed
|
||||
* to receive MPT. Return tecNO_AUTH if it doesn't
|
||||
|
||||
@@ -74,7 +74,8 @@ isVaultPseudoAccountFrozen(
|
||||
}
|
||||
if constexpr (std::is_same_v<T, SLE>)
|
||||
{
|
||||
return mptShare[sfAccount];
|
||||
MPTID const mptID = mptShare[sfMPTokenIssuanceID];
|
||||
return getMPTIssuer(mptID);
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
@@ -410,7 +410,8 @@ enforceMPTokenAuthorization(
|
||||
MPTID const& mptIssuanceID,
|
||||
AccountID const& account,
|
||||
XRPAmount const& priorBalance, // for MPToken authorization
|
||||
beast::Journal j)
|
||||
beast::Journal j,
|
||||
std::uint32_t flags)
|
||||
{
|
||||
auto const sleIssuance = view.read(keylet::mptIssuance(mptIssuanceID));
|
||||
if (!sleIssuance)
|
||||
@@ -491,7 +492,8 @@ enforceMPTokenAuthorization(
|
||||
priorBalance, // priorBalance
|
||||
mptIssuanceID, // mptIssuanceID
|
||||
account, // account
|
||||
j);
|
||||
j,
|
||||
flags);
|
||||
!isTesSuccess(err))
|
||||
return err;
|
||||
|
||||
|
||||
@@ -230,8 +230,8 @@ VaultCreate::doApply()
|
||||
view().insert(vault);
|
||||
|
||||
// Explicitly create MPToken for the vault owner
|
||||
if (auto const err =
|
||||
authorizeMPToken(view(), preFeeBalance_, mptIssuanceID, account_, ctx_.journal);
|
||||
if (auto const err = authorizeMPToken(
|
||||
view(), preFeeBalance_, mptIssuanceID, account_, ctx_.journal, lsfMPTVault);
|
||||
!isTesSuccess(err))
|
||||
return err;
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ VaultDeposit::doApply()
|
||||
if (vault->isFlag(lsfVaultPrivate) && account_ != vault->at(sfOwner))
|
||||
{
|
||||
if (auto const err = enforceMPTokenAuthorization(
|
||||
ctx_.view(), mptIssuanceID, account_, preFeeBalance_, j_);
|
||||
ctx_.view(), mptIssuanceID, account_, preFeeBalance_, j_, lsfMPTVault);
|
||||
!isTesSuccess(err))
|
||||
return err;
|
||||
}
|
||||
@@ -169,7 +169,12 @@ VaultDeposit::doApply()
|
||||
if (!view().exists(keylet::mptoken(mptIssuanceID, account_)))
|
||||
{
|
||||
if (auto const err = authorizeMPToken(
|
||||
view(), preFeeBalance_, mptIssuanceID->value(), account_, ctx_.journal);
|
||||
view(),
|
||||
preFeeBalance_,
|
||||
mptIssuanceID->value(),
|
||||
account_,
|
||||
ctx_.journal,
|
||||
lsfMPTVault);
|
||||
!isTesSuccess(err))
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user