issuing URITokens is account deletion blocker

This commit is contained in:
Richard Holland
2023-10-26 16:20:01 +00:00
committed by RichardAH
parent ac5ff4ca32
commit 1516900c4f
3 changed files with 10 additions and 0 deletions

View File

@@ -224,6 +224,11 @@ DeleteAccount::preclaim(PreclaimContext const& ctx)
return tecHAS_OBLIGATIONS;
}
// accounts that have issued URITokens are not allowed to be deleted
// this should be updated in future to be a counter
if (sleAccount->getFlags() & lsfURITokenIssuer)
return tecHAS_OBLIGATIONS;
if (ctx.view.rules().enabled(featureNonFungibleTokensV1))
{
// If an issuer has any issued NFTs resident in the ledger then it

View File

@@ -424,6 +424,9 @@ URIToken::doApply()
sleU->setFieldU64(sfOwnerNode, *page);
view().insert(sleU);
// ensure there is a deletion blocker against the issuer now
sle->setFieldU32(sfFlags, sle->getFlags() | lsfURITokenIssuer);
adjustOwnerCount(view(), sle, 1, j);
return tesSUCCESS;
}

View File

@@ -283,6 +283,8 @@ enum LedgerSpecificFlags {
0x10000000, // True, reject new paychans
lsfDisallowIncomingTrustline =
0x20000000, // True, reject new trustlines (only if no issued assets)
lsfURITokenIssuer =
0x40000000, // True, has minted tokens in the past
// ltOFFER
lsfPassive = 0x00010000,