diff --git a/src/ripple/app/hook/impl/applyHook.cpp b/src/ripple/app/hook/impl/applyHook.cpp index a39e83cbc..273aef0c4 100644 --- a/src/ripple/app/hook/impl/applyHook.cpp +++ b/src/ripple/app/hook/impl/applyHook.cpp @@ -95,9 +95,26 @@ namespace hook auto const owner = ut->getAccountID(sfOwner); auto const issuer = ut->getAccountID(sfIssuer); - // the issuer is a strong tsh if the burnable flag is set - if (issuer != owner) - ADD_TSH(issuer, ut->getFlags() & tfBurnable); + + // three possible burn scenarios: + // the burner is the owner and issuer of the token + // the burner is the owner and not the issuer of the token + // the burner is the issuer and not the owner of the token + + if (issuer == owner) + { + // pass, already a TSH + } + else if (*otxnAcc == owner) + { + // the owner burns their token, and the issuer is a weak TSH + ADD_TSH(issuer, canRollback); + } + else + { + // the issuer burns the owner's token, and the owner is a weak TSH + ADD_TSH(owner, canRollback); + } break; } @@ -4894,7 +4911,7 @@ DEFINE_HOOK_FUNCTION( } else if (man == 0) { - out[0] = 0b11000000U; + out[0] = 0b10000000U; for (int i = 1; i < 8; ++i) out[i] = 0; } diff --git a/src/ripple/app/tx/impl/ClaimReward.cpp b/src/ripple/app/tx/impl/ClaimReward.cpp index db61b8b3a..d3e303d5e 100644 --- a/src/ripple/app/tx/impl/ClaimReward.cpp +++ b/src/ripple/app/tx/impl/ClaimReward.cpp @@ -48,6 +48,13 @@ ClaimReward::preflight(PreflightContext const& ctx) if (ctx.tx.isFieldPresent(sfFlags) && ctx.tx.getFieldU32(sfFlags) > 1) return temINVALID_FLAG; + if (ctx.tx.isFieldPresent(sfIssuer) && ctx.tx.getAccountID(sfIssuer) == ctx.tx.getAccountID(sfAccount)) + { + JLOG(ctx.j.warn()) + << "ClaimReward: Issuer cannot be the source account."; + return temMALFORMED; + } + return preflight2(ctx); } diff --git a/src/ripple/app/tx/impl/Import.cpp b/src/ripple/app/tx/impl/Import.cpp index 683be29a6..2466eacee 100644 --- a/src/ripple/app/tx/impl/Import.cpp +++ b/src/ripple/app/tx/impl/Import.cpp @@ -129,6 +129,14 @@ Import::preflight(PreflightContext const& ctx) if (!ctx.rules.enabled(featureHooksUpdate1) && ctx.tx.isFieldPresent(sfIssuer)) return temDISABLED; + if (ctx.tx.isFieldPresent(sfIssuer) && + ctx.tx.getAccountID(sfIssuer) == ctx.tx.getAccountID(sfAccount)) + { + JLOG(ctx.j.warn()) + << "Import: Issuer cannot be the source account."; + return temMALFORMED; + } + if (auto const ret = preflight1(ctx); !isTesSuccess(ret)) return ret;