mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix transaction load/save functions.
This commit is contained in:
@@ -294,7 +294,7 @@ void Ledger::saveAcceptedLedger(Ledger::pointer ledger)
|
|||||||
Log(lsTRACE) << "ActTx: " << sql;
|
Log(lsTRACE) << "ActTx: " << sql;
|
||||||
db->executeSQL(sql);
|
db->executeSQL(sql);
|
||||||
db->executeSQL(txn.getSQLInsertHeader() + txn.getSQL(ledger->getLedgerSeq(), TXN_SQL_VALIDATED) + ";");
|
db->executeSQL(txn.getSQLInsertHeader() + txn.getSQL(ledger->getLedgerSeq(), TXN_SQL_VALIDATED) + ";");
|
||||||
// FIXME: If above updates no rows, modify seq/status
|
// FIXME: If above updates no rows, modify seq/status (upsert)
|
||||||
}
|
}
|
||||||
db->executeSQL("COMMIT TRANSACTION;");
|
db->executeSQL("COMMIT TRANSACTION;");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
#define TXN_SQL_CONFLICT 'C'
|
#define TXN_SQL_CONFLICT 'C'
|
||||||
#define TXN_SQL_HELD 'H'
|
#define TXN_SQL_HELD 'H'
|
||||||
#define TXN_SQL_VALIDATED 'V'
|
#define TXN_SQL_VALIDATED 'V'
|
||||||
|
#define TXN_SQL_INCLUDED 'I'
|
||||||
|
#define TXN_SQL_UNKNOWN 'U'
|
||||||
|
|
||||||
class SerializedTransaction : public SerializedType
|
class SerializedTransaction : public SerializedType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -248,10 +248,11 @@ public:
|
|||||||
|
|
||||||
void setStatus(TransStatus status, uint32 ledgerSeq);
|
void setStatus(TransStatus status, uint32 ledgerSeq);
|
||||||
void setStatus(TransStatus status) { mStatus=status; }
|
void setStatus(TransStatus status) { mStatus=status; }
|
||||||
|
void setLedger(uint32 ledger) { mInLedger = ledger; }
|
||||||
|
|
||||||
// database functions
|
// database functions
|
||||||
static void saveTransaction(Transaction::pointer);
|
static void saveTransaction(Transaction::pointer);
|
||||||
bool save() const;
|
bool save();
|
||||||
static Transaction::pointer load(const uint256& id);
|
static Transaction::pointer load(const uint256& id);
|
||||||
static Transaction::pointer findFrom(const NewcoinAddress& fromID, uint32 seq);
|
static Transaction::pointer findFrom(const NewcoinAddress& fromID, uint32 seq);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user