Implement clearing the regular key, setting and clearing the no master

flag and enforcing the no master flag.
This commit is contained in:
JoelKatz
2013-06-17 12:14:03 -07:00
parent 1886283244
commit 36a84484e0
9 changed files with 57 additions and 6 deletions

View File

@@ -105,6 +105,34 @@ TER AccountSetTransactor::doApply ()
uFlagsOut &= ~lsfDisallowXRP;
}
//
// DisableMaster
//
if ((tfDisableMaster | tfEnableMaster) == (uTxFlags & (tfDisableMaster | tfEnableMaster)))
{
WriteLog (lsINFO, AccountSetTransactor) << "AccountSet: Malformed transaction: Contradictory flags set.";
return temINVALID_FLAG;
}
if ((uTxFlags & tfDisableMaster) && !isSetBit (uFlagsIn, lsfDisableMaster))
{
if (!mTxnAccount->isFieldPresent (sfRegularKey))
return tefNO_REGULAR_KEY;
WriteLog (lsINFO, AccountSetTransactor) << "AccountSet: Set lsfDisableMaster.";
uFlagsOut |= lsfDisableMaster;
}
if ((uTxFlags & tfEnableMaster) && isSetBit (uFlagsIn, lsfDisableMaster))
{
WriteLog (lsINFO, AccountSetTransactor) << "AccountSet: Clear lsfDisableMaster.";
uFlagsOut &= ~lsfDisableMaster;
}
//
// EmailHash
//