mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Support AccountTxnID and LastLedgerSequence.
This commit is contained in:
@@ -156,6 +156,24 @@ TER AccountSetTransactor::doApply ()
|
||||
uFlagsOut &= ~lsfDisableMaster;
|
||||
}
|
||||
|
||||
//
|
||||
// Track transaction IDs signed by this account in its root
|
||||
//
|
||||
|
||||
if ((uSetFlag == asfAccountTxnID) && (uClearFlag != asfAccountTxnID) && !mTxnAccount->isFieldPresent (sfAccountTxnID))
|
||||
{
|
||||
WriteLog (lsINFO, AccountSetTransactor) << "AccountSet: Set AccountTxnID";
|
||||
|
||||
mTxnAccount->makeFieldPresent (sfAccountTxnID);
|
||||
}
|
||||
|
||||
if ((uClearFlag == asfAccountTxnID) && (uSetFlag != asfAccountTxnID) && mTxnAccount->isFieldPresent (sfAccountTxnID))
|
||||
{
|
||||
WriteLog (lsINFO, AccountSetTransactor) << "AccountSet: Clear AccountTxnID";
|
||||
|
||||
mTxnAccount->makeFieldAbsent (sfAccountTxnID);
|
||||
}
|
||||
|
||||
//
|
||||
// EmailHash
|
||||
//
|
||||
|
||||
@@ -170,12 +170,24 @@ TER Transactor::checkSeq ()
|
||||
return tefPAST_SEQ;
|
||||
}
|
||||
|
||||
// Deprecated: Do not use
|
||||
if (mTxn.isFieldPresent (sfPreviousTxnID) &&
|
||||
(mTxnAccount->getFieldH256 (sfPreviousTxnID) != mTxn.getFieldH256 (sfPreviousTxnID)))
|
||||
return tefWRONG_PRIOR;
|
||||
|
||||
if (mTxn.isFieldPresent (sfAccountTxnID) &&
|
||||
(mTxnAccount->getFieldH256 (sfAccountTxnID) != mTxn.getFieldH256 (sfAccountTxnID)))
|
||||
return tefWRONG_PRIOR;
|
||||
|
||||
if (mTxn.isFieldPresent (sfLastLedgerSequence) &&
|
||||
(mEngine->getLedger()->getLedgerSeq() > mTxn.getFieldU32 (sfLastLedgerSequence)))
|
||||
return tefMAX_LEDGER;
|
||||
|
||||
mTxnAccount->setFieldU32 (sfSequence, t_seq + 1);
|
||||
|
||||
if (mTxnAccount->isFieldPresent (sfAccountTxnID))
|
||||
mTxnAccount->setFieldH256 (sfAccountTxnID, mTxn.getTransactionID ());
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ LedgerFormats::LedgerFormats ()
|
||||
<< SOElement (sfOwnerCount, SOE_REQUIRED)
|
||||
<< SOElement (sfPreviousTxnID, SOE_REQUIRED)
|
||||
<< SOElement (sfPreviousTxnLgrSeq, SOE_REQUIRED)
|
||||
<< SOElement (sfAccountTxnID, SOE_OPTIONAL)
|
||||
<< SOElement (sfRegularKey, SOE_OPTIONAL)
|
||||
<< SOElement (sfEmailHash, SOE_OPTIONAL)
|
||||
<< SOElement (sfWalletLocator, SOE_OPTIONAL)
|
||||
|
||||
@@ -118,6 +118,7 @@ FIELD (PreviousTxnID, HASH256, 5)
|
||||
FIELD (LedgerIndex, HASH256, 6)
|
||||
FIELD (WalletLocator, HASH256, 7)
|
||||
FIELD (RootIndex, HASH256, 8)
|
||||
FIELD (AccountTxnID, HASH256, 9)
|
||||
|
||||
// 256-bit (uncommon)
|
||||
FIELD (BookDirectory, HASH256, 16)
|
||||
|
||||
@@ -63,6 +63,7 @@ bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman)
|
||||
{ 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." },
|
||||
{ tefMAX_LEDGER, "tefMAX_LEDGER", "Ledger sequence too high." },
|
||||
|
||||
{ telLOCAL_ERROR, "telLOCAL_ERROR", "Local failure." },
|
||||
{ telBAD_DOMAIN, "telBAD_DOMAIN", "Domain too long." },
|
||||
|
||||
@@ -108,6 +108,7 @@ enum TER // aka TransactionEngineResult
|
||||
tefPAST_SEQ,
|
||||
tefWRONG_PRIOR,
|
||||
tefMASTER_DISABLED,
|
||||
tefMAX_LEDGER,
|
||||
|
||||
// -99 .. -1: R Retry (sequence too high, no funds for txn fee, originating account non-existent)
|
||||
// Causes:
|
||||
|
||||
@@ -55,6 +55,7 @@ const uint32 asfRequireDest = 1;
|
||||
const uint32 asfRequireAuth = 2;
|
||||
const uint32 asfDisallowXRP = 3;
|
||||
const uint32 asfDisableMaster = 4;
|
||||
const uint32 asfAccountTxnID = 5;
|
||||
|
||||
// OfferCreate flags:
|
||||
const uint32 tfPassive = 0x00010000;
|
||||
|
||||
@@ -95,7 +95,9 @@ void TxFormats::addCommonFields (Item& item)
|
||||
<< SOElement(sfSourceTag, SOE_OPTIONAL)
|
||||
<< SOElement(sfAccount, SOE_REQUIRED)
|
||||
<< SOElement(sfSequence, SOE_REQUIRED)
|
||||
<< SOElement(sfPreviousTxnID, SOE_OPTIONAL)
|
||||
<< SOElement(sfPreviousTxnID, SOE_OPTIONAL) // Deprecated: Do not use
|
||||
<< SOElement(sfLastLedgerSequence, SOE_OPTIONAL)
|
||||
<< SOElement(sfAccountTxnID, SOE_OPTIONAL)
|
||||
<< SOElement(sfFee, SOE_REQUIRED)
|
||||
<< SOElement(sfOperationLimit, SOE_OPTIONAL)
|
||||
<< SOElement(sfSigningPubKey, SOE_REQUIRED)
|
||||
|
||||
Reference in New Issue
Block a user