mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
More work on core ledger and transaction processing code.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include "key.h"
|
||||
#include "uint256.h"
|
||||
#include "newcoin.pb.h"
|
||||
#include "Hanko.h"
|
||||
@@ -31,40 +32,42 @@ class LocalAccount;
|
||||
class Transaction : public boost::enable_shared_from_this<Transaction>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef boost::shared_ptr<Transaction> pointer;
|
||||
|
||||
static const uint32 TransSignMagic=0x54584E00; // "TXN"
|
||||
|
||||
private:
|
||||
uint256 mTransactionID;
|
||||
uint160 mAccountFrom, mAccountTo;
|
||||
uint64 mAmount;
|
||||
uint64 mAmount, mFee;
|
||||
uint32 mFromAccountSeq, mSourceLedger, mIdent;
|
||||
CKey mFromPubKey;
|
||||
std::vector<unsigned char> mSignature;
|
||||
|
||||
uint32 mInLedger;
|
||||
TransStatus mStatus;
|
||||
|
||||
Account::pointer mpAccountFrom;
|
||||
|
||||
public:
|
||||
Transaction();
|
||||
Transaction(const std::vector<unsigned char> rawTransaction);
|
||||
Transaction(const std::string sqlReply);
|
||||
Transaction(TransStatus Status, LocalAccount& fromLocal, Account& from,
|
||||
uint32 fromSeq, const uint160& to, uint64 amount, uint32 ident, uint32 ledger);
|
||||
|
||||
void setFromAccountPointer(Account::pointer af) { mpAccountFrom=af; }
|
||||
Transaction(const std::vector<unsigned char>& rawTransaction, bool validate);
|
||||
Transaction(TransStatus Status, LocalAccount& fromLocal, uint32 fromSeq, const uint160& to, uint64 amount,
|
||||
uint32 ident, uint32 ledger);
|
||||
|
||||
bool sign(LocalAccount& fromLocalAccount);
|
||||
bool checkSign() const;
|
||||
void updateID();
|
||||
void updateFee();
|
||||
|
||||
Serializer::pointer getRawUnsigned() const;
|
||||
Serializer::pointer getRawSigned() const;
|
||||
Serializer::pointer getRaw(bool prefix) const;
|
||||
Serializer::pointer getSigned() const;
|
||||
|
||||
const uint256& getID() const { return mTransactionID; }
|
||||
const uint160& getFromAccount() const { return mAccountFrom; }
|
||||
const uint160& getToAccount() const { return mAccountTo; }
|
||||
uint64 getAmount() const { return mAmount; }
|
||||
uint64 getFee() const { return mFee; }
|
||||
uint32 getFromAccountSeq() const { return mFromAccountSeq; }
|
||||
uint32 getSourceLedger() const { return mSourceLedger; }
|
||||
uint32 getIdent() const { return mIdent; }
|
||||
@@ -72,8 +75,7 @@ public:
|
||||
uint32 getLedger() const { return mInLedger; }
|
||||
TransStatus getStatus() const { return mStatus; }
|
||||
|
||||
void setStatus(TransStatus st);
|
||||
void setLedger(uint32 Ledger);
|
||||
void setStatus(TransStatus status, uint32 ledgerSeq);
|
||||
|
||||
bool operator<(const Transaction &) const;
|
||||
bool operator>(const Transaction &) const;
|
||||
@@ -83,6 +85,4 @@ public:
|
||||
bool operator>=(const Transaction &) const;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Transaction> TransactionPtr;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user