mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
add another check
This commit is contained in:
@@ -448,10 +448,13 @@ ValidConfidentialMPToken::visitEntry(
|
||||
|
||||
bool const hasAnyHolder = hasHolderInbox || hasHolderSpending;
|
||||
|
||||
if (hasAnyHolder != hasIssuerBalance)
|
||||
{
|
||||
// sfIssuerEncryptedBalance, sfConfidentialBalanceInbox, and sfConfidentialBalanceSpending
|
||||
// must all exist or not exist same time.
|
||||
if (hasHolderInbox != hasHolderSpending)
|
||||
changes_[id].badConsistency = true;
|
||||
|
||||
if (hasHolderInbox != hasIssuerBalance)
|
||||
changes_[id].badConsistency = true;
|
||||
}
|
||||
|
||||
// Privacy flag consistency
|
||||
bool const hasEncrypted = hasAnyHolder || hasIssuerBalance;
|
||||
|
||||
@@ -4306,8 +4306,10 @@ class Invariants_test : public beast::unit_test::suite
|
||||
auto sleToken = ac.view().peek(keylet::mptoken(mptID, A2.id()));
|
||||
if (!sleToken)
|
||||
return false;
|
||||
// Inject fields correctly, but the Issuance was built without the privacy flag.
|
||||
// Inject all three encrypted fields consistently (inbox+spending+issuer must be
|
||||
// in sync or badConsistency fires first and masks requiresPrivacyFlag).
|
||||
sleToken->setFieldVL(sfConfidentialBalanceInbox, Blob{0x00});
|
||||
sleToken->setFieldVL(sfConfidentialBalanceSpending, Blob{0x00});
|
||||
sleToken->setFieldVL(sfIssuerEncryptedBalance, Blob{0x00});
|
||||
ac.view().update(sleToken);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user