Permalink
Browse files

remove lsfPasswordSpent

  • Loading branch information...
jedmccaleb committed Jul 26, 2014
1 parent 050bdcc commit 054c0a848af89f1e76c64f0aac424eadf7bca007
@@ -269,9 +269,6 @@ TER PaymentTransactor::doApply ()
mTxnAccount->setFieldAmount (sfBalance, mSourceBalance - saDstAmount);
sleDst->setFieldAmount (sfBalance, sleDst->getFieldAmount (sfBalance) + saDstAmount);
// re-arm the password change fee if we can and need to
if ((sleDst->getFlags () & lsfPasswordSpent))
sleDst->clearFlag (lsfPasswordSpent);
terResult = tesSUCCESS;
}
@@ -34,8 +34,6 @@ TER AccountSetTransactor::doApply ()
bool bClearRequireDest = (uTxFlags & tfOptionalDestTag) || (uClearFlag == asfRequireDest);
bool bSetRequireAuth = (uTxFlags & tfRequireAuth) || (uSetFlag == asfRequireAuth);
bool bClearRequireAuth = (uTxFlags & tfOptionalAuth) || (uClearFlag == asfRequireAuth);
bool bSetDisallowSTR = (uTxFlags & tfDisallowSTR) || (uSetFlag == asfDisallowSTR);
bool bClearDisallowSTR = (uTxFlags & tfAllowSTR) || (uClearFlag == asfDisallowSTR);
if (uTxFlags & tfAccountSetMask)
{
@@ -94,166 +92,7 @@ TER AccountSetTransactor::doApply ()
uFlagsOut &= ~lsfRequireDestTag;
}
//
// DisallowSTR
//
/*
if (bSetDisallowSTR && bClearDisallowSTR)
{
m_journal.trace << "Malformed transaction: Contradictory flags set.";
return temINVALID_FLAG;
}
if (bSetDisallowSTR && !is_bit_set (uFlagsIn, lsfDisallowSTR))
{
m_journal.trace << "Set lsfDisallowSTR.";
uFlagsOut |= lsfDisallowSTR;
}
if (bClearDisallowSTR && is_bit_set (uFlagsIn, lsfDisallowSTR))
{
m_journal.trace << "Clear lsfDisallowSTR.";
uFlagsOut &= ~lsfDisallowSTR;
}
*/
//
// DisableMaster
//
/*
if ((uSetFlag == asfDisableMaster) && (uClearFlag == asfDisableMaster))
{
m_journal.trace << "Malformed transaction: Contradictory flags set.";
return temINVALID_FLAG;
}
if ((uSetFlag == asfDisableMaster) && !is_bit_set (uFlagsIn, lsfDisableMaster))
{
if (!mTxnAccount->isFieldPresent (sfRegularKey))
return tecNO_REGULAR_KEY;
m_journal.trace << "Set lsfDisableMaster.";
uFlagsOut |= lsfDisableMaster;
}
if ((uClearFlag == asfDisableMaster) && is_bit_set (uFlagsIn, lsfDisableMaster))
{
m_journal.trace << "Clear lsfDisableMaster.";
uFlagsOut &= ~lsfDisableMaster;
}
*/
//
// Track transaction IDs signed by this account in its root
//
/*
if ((uSetFlag == asfAccountTxnID) && (uClearFlag != asfAccountTxnID) && !mTxnAccount->isFieldPresent (sfAccountTxnID))
{
m_journal.trace << "Set AccountTxnID";
mTxnAccount->makeFieldPresent (sfAccountTxnID);
}
if ((uClearFlag == asfAccountTxnID) && (uSetFlag != asfAccountTxnID) && mTxnAccount->isFieldPresent (sfAccountTxnID))
{
m_journal.trace << "Clear AccountTxnID";
mTxnAccount->makeFieldAbsent (sfAccountTxnID);
}
*/
//
// EmailHash
//
/*
if (mTxn.isFieldPresent (sfEmailHash))
{
uint128 uHash = mTxn.getFieldH128 (sfEmailHash);
if (!uHash)
{
m_journal.trace << "unset email hash";
mTxnAccount->makeFieldAbsent (sfEmailHash);
}
else
{
m_journal.trace << "set email hash";
mTxnAccount->setFieldH128 (sfEmailHash, uHash);
}
}
*/
//
// WalletLocator
//
/*
if (mTxn.isFieldPresent (sfWalletLocator))
{
uint256 uHash = mTxn.getFieldH256 (sfWalletLocator);
if (!uHash)
{
m_journal.trace << "unset wallet locator";
mTxnAccount->makeFieldAbsent (sfEmailHash);
}
else
{
m_journal.trace << "set wallet locator";
mTxnAccount->setFieldH256 (sfWalletLocator, uHash);
}
}
*/
//
// MessageKey
//
/*
if (mTxn.isFieldPresent (sfMessageKey))
{
Blob vucPublic = mTxn.getFieldVL (sfMessageKey);
if (vucPublic.empty ())
{
m_journal.debug << "set message key";
mTxnAccount->makeFieldAbsent (sfMessageKey);
}
if (vucPublic.size () > PUBLIC_BYTES_MAX)
{
m_journal.trace << "message key too long";
return telBAD_PUBLIC_KEY;
}
else
{
m_journal.debug << "set message key";
mTxnAccount->setFieldVL (sfMessageKey, vucPublic);
}
}
*/
//
// Domain
//
/*
if (mTxn.isFieldPresent (sfDomain))
{
Blob vucDomain = mTxn.getFieldVL (sfDomain);
if (vucDomain.empty ())
{
m_journal.trace << "unset domain";
mTxnAccount->makeFieldAbsent (sfDomain);
}
else if (vucDomain.size () > DOMAIN_BYTES_MAX)
{
m_journal.trace << "domain too long";
return telBAD_DOMAIN;
}
else
{
m_journal.trace << "set domain";
mTxnAccount->setFieldVL (sfDomain, vucDomain);
}
}
*/
//
// InflationDest
//
@@ -19,18 +19,6 @@
namespace ripple {
std::uint64_t RegularKeySetTransactor::calculateBaseFee ()
{
if ( mTxnAccount
&& (! (mTxnAccount->getFlags () & lsfPasswordSpent))
&& (mSigningPubKey.getAccountID () == mTxnAccountID))
{
// flag is armed and they signed with the right account
return 0;
}
return Transactor::calculateBaseFee ();
}
TER RegularKeySetTransactor::doApply ()
@@ -45,11 +33,6 @@ TER RegularKeySetTransactor::doApply ()
return temINVALID_FLAG;
}
if (mFeeDue == zero)
{
mTxnAccount->setFlag (lsfPasswordSpent);
}
if (mTxn.isFieldPresent (sfRegularKey))
{
uint160 uAuthKeyID = mTxn.getFieldAccount160 (sfRegularKey);
@@ -34,7 +34,7 @@ LogPartition::getPartitionName <RegularKeySetTransactorLog> ()
class RegularKeySetTransactor
: public Transactor
{
std::uint64_t calculateBaseFee ();
public:
RegularKeySetTransactor (
@@ -97,7 +97,6 @@ enum LedgerNameSpace
enum LedgerSpecificFlags
{
// ltACCOUNT_ROOT
lsfPasswordSpent = 0x00010000, // True, if password set fee is spent.
lsfRequireDestTag = 0x00020000, // True, to require a DestinationTag for payments.
lsfRequireAuth = 0x00040000, // True, to require a authorization to hold IOUs.
lsfDisallowSTR = 0x00080000, // True, to disallow sending STR.
@@ -60,9 +60,6 @@ const std::uint32_t tfAccountSetMask = ~ (tfUniversal | TxFlag::requireDes
// AccountSet SetFlag/ClearFlag values
const std::uint32_t asfRequireDest = 1;
const std::uint32_t asfRequireAuth = 2;
const std::uint32_t asfDisallowSTR = 3;
const std::uint32_t asfDisableMaster = 4;
const std::uint32_t asfAccountTxnID = 5;
// OfferCreate flags:
const std::uint32_t tfPassive = 0x00010000;

0 comments on commit 054c0a8

Please sign in to comment.