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

@@ -531,6 +531,11 @@ bool STObject::clearFlag (uint32 f)
return true;
}
bool STObject::isFlag (uint32 f)
{
return (getFlags () & f) == f;
}
uint32 STObject::getFlags (void) const
{
const STUInt32* t = dynamic_cast<const STUInt32*> (peekAtPField (sfFlags));

View File

@@ -136,6 +136,7 @@ public:
bool setFlag (uint32);
bool clearFlag (uint32);
bool isFlag(uint32);
uint32 getFlags () const;
uint256 getHash (uint32 prefix) const;

View File

@@ -46,6 +46,8 @@ bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman)
{ tefNO_AUTH_REQUIRED, "tefNO_AUTH_REQUIRED", "Auth is not required." },
{ tefPAST_SEQ, "tefPAST_SEQ", "This sequence number has already past." },
{ tefWRONG_PRIOR, "tefWRONG_PRIOR", "This previous transaction does not match." },
{ tefMASTER_DISABLED, "tefMASTER_DISABLED", "Master key is disabled." },
{ tefNO_REGULAR_KEY, "tefNO_REGULAR_KEY", "Regular key is not set." },
{ telLOCAL_ERROR, "telLOCAL_ERROR", "Local failure." },
{ telBAD_DOMAIN, "telBAD_DOMAIN", "Domain too long." },

View File

@@ -94,6 +94,8 @@ enum TER // aka TransactionEngineResult
tefNO_AUTH_REQUIRED, // Can't set auth if auth is not required.
tefPAST_SEQ,
tefWRONG_PRIOR,
tefMASTER_DISABLED,
tefNO_REGULAR_KEY,
// -99 .. -1: R Retry (sequence too high, no funds for txn fee, originating account non-existent)
// Causes:

View File

@@ -51,7 +51,7 @@ void TFInit ()
;
DECLARE_TF (SetRegularKey, ttREGULAR_KEY_SET)
<< SOElement (sfRegularKey, SOE_REQUIRED)
<< SOElement (sfRegularKey, SOE_OPTIONAL)
;
DECLARE_TF (Payment, ttPAYMENT)