mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-26 00:20:41 +00:00
fix SponsorshipTransfer too
This commit is contained in:
@@ -265,6 +265,32 @@ SponsorshipTransfer::preclaim(PreclaimContext const& ctx)
|
||||
if (!sle)
|
||||
return tecNO_ENTRY;
|
||||
|
||||
// v1 scope: an object is only sponsorable via SponsorshipTransfer if
|
||||
// its creating transaction type is itself permitted to set
|
||||
// spfSponsorReserve (the allow-list in preflight1Sponsor). Otherwise
|
||||
// an Oracle / Ticket / DID / etc. could be retroactively sponsored
|
||||
// even though its creating tx cannot be, leaving downstream
|
||||
// transactors with no path to maintain the sponsorship invariants.
|
||||
switch (sle->getType())
|
||||
{
|
||||
case ltDELEGATE:
|
||||
case ltDEPOSIT_PREAUTH:
|
||||
case ltMPTOKEN:
|
||||
case ltMPTOKEN_ISSUANCE:
|
||||
case ltLOAN:
|
||||
case ltCREDENTIAL:
|
||||
case ltRIPPLE_STATE:
|
||||
// TBD object types (Check / Escrow / PaymentChannel) — kept
|
||||
// sponsorable in v1; revisit when their tx-level support is
|
||||
// formalized.
|
||||
case ltCHECK:
|
||||
case ltESCROW:
|
||||
case ltPAYCHAN:
|
||||
break;
|
||||
default:
|
||||
return tecNO_PERMISSION;
|
||||
}
|
||||
|
||||
auto const ownerCountDelta = getLedgerEntryOwnerCount(sle);
|
||||
|
||||
auto const owner = getLedgerEntryOwner(ctx.view, sle, sponseeID);
|
||||
|
||||
Reference in New Issue
Block a user