mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Changes to support threading through account roots, offers, and ripple state nodes.
Fix tracking the last transaction signed by an account.
This commit is contained in:
@@ -10,6 +10,8 @@ LedgerEntryFormat LedgerFormats[]=
|
||||
{ S_FIELD(Sequence), STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(Balance), STI_AMOUNT, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastReceive), STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastSignedSeq), STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastTxnID), STI_HASH256, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastTxnSeq), STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(AuthorizedKey), STI_ACCOUNT, SOE_IFFLAG, 1 },
|
||||
{ S_FIELD(EmailHash), STI_HASH128, SOE_IFFLAG, 2 },
|
||||
@@ -52,6 +54,8 @@ LedgerEntryFormat LedgerFormats[]=
|
||||
{ S_FIELD(BookDirectory), STI_HASH256, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(BookNode), STI_UINT64, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(OwnerNode), STI_UINT64, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastTxnID), STI_HASH256, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastTxnSeq), STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(PaysIssuer), STI_ACCOUNT, SOE_IFFLAG, 1 },
|
||||
{ S_FIELD(GetsIssuer), STI_ACCOUNT, SOE_IFFLAG, 2 },
|
||||
{ S_FIELD(Expiration), STI_UINT32, SOE_IFFLAG, 4 },
|
||||
@@ -65,6 +69,8 @@ LedgerEntryFormat LedgerFormats[]=
|
||||
{ S_FIELD(LowLimit), STI_AMOUNT, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(HighID), STI_ACCOUNT, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(HighLimit), STI_AMOUNT, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastTxnID), STI_HASH256, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LastTxnSeq), STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ S_FIELD(LowQualityIn), STI_UINT32, SOE_IFFLAG, 1 },
|
||||
{ S_FIELD(LowQualityOut), STI_UINT32, SOE_IFFLAG, 2 },
|
||||
{ S_FIELD(HighQualityIn), STI_UINT32, SOE_IFFLAG, 4 },
|
||||
|
||||
@@ -96,13 +96,17 @@ uint32 SerializedLedgerEntry::getThreadedLedger()
|
||||
return getIFieldU32(sfLastTxnSeq);
|
||||
}
|
||||
|
||||
void SerializedLedgerEntry::thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID)
|
||||
bool SerializedLedgerEntry::thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID)
|
||||
{
|
||||
prevTxID = getIFieldH256(sfLastTxnID);
|
||||
uint256 oldPrevTxID = getIFieldH256(sfLastTxnID);
|
||||
if (oldPrevTxID == txID)
|
||||
return false;
|
||||
prevTxID = oldPrevTxID;
|
||||
prevLedgerID = getIFieldU32(sfLastTxnID);
|
||||
assert(prevTxID != txID);
|
||||
setIFieldH256(sfLastTxnID, txID);
|
||||
setIFieldU32(sfLastTxnSeq, ledgerSeq);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<uint256> SerializedLedgerEntry::getOwners()
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
bool isThreaded(); // is this ledger entry actually threaded
|
||||
uint256 getThreadedTransaction();
|
||||
uint32 getThreadedLedger();
|
||||
void thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID);
|
||||
bool thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID);
|
||||
std::vector<uint256> getOwners(); // nodes notified if this node is deleted
|
||||
|
||||
void setIFieldU8(SOE_Field field, unsigned char v) { return mObject.setValueFieldU8(field, v); }
|
||||
|
||||
@@ -63,6 +63,7 @@ enum SOE_Field
|
||||
sfInvoiceID,
|
||||
sfLastNode,
|
||||
sfLastReceive,
|
||||
sfLastSignedSeq,
|
||||
sfLastTxnID,
|
||||
sfLastTxnSeq,
|
||||
sfLedgerHash,
|
||||
|
||||
@@ -1219,6 +1219,7 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran
|
||||
terResult = terPAST_SEQ;
|
||||
}
|
||||
}
|
||||
mTxnAccount->setIFieldU32(sfLastSignedSeq, mLedger->getLedgerSeq());
|
||||
|
||||
if (terSUCCESS == terResult)
|
||||
{
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
// Version we prefer to speak:
|
||||
#define PROTO_VERSION_MAJOR 0
|
||||
#define PROTO_VERSION_MINOR 4
|
||||
#define PROTO_VERSION_MINOR 5
|
||||
|
||||
// Version we wil speak to:
|
||||
#define MIN_PROTO_MAJOR 0
|
||||
#define MIN_PROTO_MINOR 4
|
||||
#define MIN_PROTO_MINOR 5
|
||||
|
||||
#define MAKE_VERSION_INT(maj,min) ((maj << 16) | min)
|
||||
#define GET_VERSION_MAJOR(ver) (ver >> 16)
|
||||
|
||||
Reference in New Issue
Block a user