diff --git a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp index 023299dfd1..b7189e77f7 100644 --- a/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp +++ b/src/xrpld/app/tx/detail/LoanBrokerCoverWithdraw.cpp @@ -74,7 +74,7 @@ LoanBrokerCoverWithdraw::preclaim(PreclaimContext const& ctx) // Withdrawal to a 3rd party destination account is essentially a transfer. // Enforce all the usual asset transfer checks. - AuthType authType = AuthType::Legacy; + AuthType authType = AuthType::WeakAuth; if (account != dstAcct) { if (auto const ret = canWithdraw(ctx.view, tx)) @@ -144,8 +144,16 @@ LoanBrokerCoverWithdraw::doApply() broker->at(sfCoverAvailable) -= amount; view().update(broker); - // Move the funds from the broker's pseudo-account to the dstAcct + // Create trust line or MPToken for the receiving account + if (dstAcct == account_) + { + if (auto const ter = addEmptyHolding( + view(), account_, mPriorBalance, amount.asset(), j_); + !isTesSuccess(ter) && ter != tecDUPLICATE) + return ter; + } + // Move the funds from the broker's pseudo-account to the dstAcct if (dstAcct == account_ || amount.native()) { // Transfer assets directly from pseudo-account to depositor. diff --git a/src/xrpld/app/tx/detail/VaultWithdraw.cpp b/src/xrpld/app/tx/detail/VaultWithdraw.cpp index 718d0653c8..de610f7785 100644 --- a/src/xrpld/app/tx/detail/VaultWithdraw.cpp +++ b/src/xrpld/app/tx/detail/VaultWithdraw.cpp @@ -247,9 +247,9 @@ VaultWithdraw::doApply() } auto const dstAcct = ctx_.tx[~sfDestination].value_or(account_); - if (!vaultAsset.native() && // - dstAcct != vaultAsset.getIssuer() && // - dstAcct == account_) + + // Create trust line or MPToken for the receiving account + if (dstAcct == account_) { if (auto const ter = addEmptyHolding( view(), account_, mPriorBalance, vaultAsset, j_);