mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-29 15:05:50 +00:00
Require the master key when performing certain operations (RIPD-666):
* When disabling the use of the master key; or * When enabling 'no freeze'.
This commit is contained in:
@@ -155,6 +155,12 @@ public:
|
||||
|
||||
if ((uSetFlag == asfDisableMaster) && !(uFlagsIn & lsfDisableMaster))
|
||||
{
|
||||
if (!mSigMaster)
|
||||
{
|
||||
m_journal.trace << "Can't use regular key to disable master key.";
|
||||
return tecNEED_MASTER_KEY;
|
||||
}
|
||||
|
||||
if (!mTxnAccount->isFieldPresent (sfRegularKey))
|
||||
return tecNO_REGULAR_KEY;
|
||||
|
||||
@@ -170,6 +176,12 @@ public:
|
||||
|
||||
if (uSetFlag == asfNoFreeze)
|
||||
{
|
||||
if (!mSigMaster && !(uFlagsIn & lsfDisableMaster))
|
||||
{
|
||||
m_journal.trace << "Can't use regular key to set NoFreeze.";
|
||||
return tecNEED_MASTER_KEY;
|
||||
}
|
||||
|
||||
m_journal.trace << "Set NoFreeze flag";
|
||||
uFlagsOut |= lsfNoFreeze;
|
||||
}
|
||||
|
||||
@@ -192,6 +192,7 @@ enum TER // aka TransactionEngineResult
|
||||
tecNO_PERMISSION = 139,
|
||||
tecNO_ENTRY = 140,
|
||||
tecINSUFFICIENT_RESERVE = 141,
|
||||
tecNEED_MASTER_KEY = 142,
|
||||
};
|
||||
|
||||
inline bool isTelLocal(TER x)
|
||||
|
||||
@@ -65,6 +65,7 @@ bool transResultInfo (TER code, std::string& token, std::string& text)
|
||||
{ tecNO_PERMISSION, "tecNO_PERMISSION", "No permission to perform requested operation." },
|
||||
{ tecNO_ENTRY, "tecNO_ENTRY", "No matching entry found." },
|
||||
{ tecINSUFFICIENT_RESERVE, "tecINSUFFICIENT_RESERVE", "Insufficient reserve to complete requested operation." },
|
||||
{ tecNEED_MASTER_KEY, "tecNEED_MASTER_KEY", "The operation requires the use of the Master Key." },
|
||||
|
||||
{ tefALREADY, "tefALREADY", "The exact transaction was already in this ledger." },
|
||||
{ tefBAD_ADD_AUTH, "tefBAD_ADD_AUTH", "Not authorized to add account." },
|
||||
|
||||
Reference in New Issue
Block a user