Do not fail VaultSet if nothing changed

One of the failure conditions for VaultSet is:
* The transaction does not specify any of the modifiable fields.

This section was added because I've misread the specification as:
"The transaction does not modify any of the modifiable fields."

Turns out I was wrong, should have read more carefully.
This commit is contained in:
Bronek Kozicki
2025-03-20 10:50:50 +00:00
parent 4e862e0afd
commit b1fc3b7c41

View File

@@ -88,22 +88,7 @@ VaultSet::preclaim(PreclaimContext const& ctx)
if (!sleIssuance)
return tefINTERNAL;
auto const domain = ctx.tx[~sfDomainID];
auto const oldDomain = sleIssuance->at(~sfDomainID);
auto const data = ctx.tx[~sfData];
auto const oldData = vault->at(~sfData);
auto const assetMax = ctx.tx[~sfAssetMaximum];
auto const oldAssetMax = vault->at(sfAssetMaximum);
int const changes = //
(domain && (domain != oldDomain)) + //
(data && (data != oldData)) + //
(assetMax && (*assetMax != oldAssetMax));
// This transaction would change nothing
if (!changes)
return tecNO_PERMISSION;
if (domain)
if (auto const domain = ctx.tx[~sfDomainID])
{
// We can only set domain if private flag was originally set
if ((vault->getFlags() & tfVaultPrivate) == 0)