mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Rename trans engine never prefix to ten.
This commit is contained in:
@@ -427,3 +427,4 @@ bool LedgerAcquireMaster::gotLedgerData(newcoin::TMLedgerData& packet, Peer::poi
|
||||
|
||||
return false;
|
||||
}
|
||||
// vim:ts=4
|
||||
|
||||
@@ -54,7 +54,7 @@ Transaction::pointer NetworkOPs::processTransaction(Transaction::pointer trans,
|
||||
}
|
||||
|
||||
TransactionEngineResult r = theApp->getMasterLedger().doTransaction(*trans->getSTransaction(), tepNONE);
|
||||
if (r == terFAILED) throw Fault(IO_ERROR);
|
||||
if (r == tenFAILED) throw Fault(IO_ERROR);
|
||||
|
||||
if (r == terPRE_SEQ)
|
||||
{ // transaction should be held
|
||||
|
||||
@@ -9,17 +9,17 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran
|
||||
TransactionEngineResult result = terSUCCESS;
|
||||
|
||||
uint256 txID = txn.getTransactionID();
|
||||
if(!txID) return terINVALID;
|
||||
if(!txID) return tenINVALID;
|
||||
|
||||
// Extract signing key
|
||||
// Transactions contain a signing key. This allows us to trivially verify a transaction has at least been properly signed
|
||||
// without going to disk. Each transaction also notes a source account id. This is used to verify that the signing key is
|
||||
// associated with the account.
|
||||
CKey acctKey;
|
||||
if (!acctKey.SetPubKey(txn.peekSigningPubKey())) return terINVALID;
|
||||
if (!acctKey.SetPubKey(txn.peekSigningPubKey())) return tenINVALID;
|
||||
|
||||
// check signature
|
||||
if (!txn.checkSign(acctKey)) return terINVALID;
|
||||
if (!txn.checkSign(acctKey)) return tenINVALID;
|
||||
|
||||
bool bPrepaid = false;
|
||||
|
||||
@@ -37,11 +37,11 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran
|
||||
break;
|
||||
|
||||
case ttINVALID:
|
||||
result = terINVALID;
|
||||
result = tenINVALID;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = terUNKNOWN;
|
||||
result = tenUNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -55,19 +55,19 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran
|
||||
{
|
||||
if (txnFee)
|
||||
// Transaction is malformed.
|
||||
return terINSUF_FEE_P;
|
||||
return tenINSUF_FEE_P;
|
||||
}
|
||||
else
|
||||
{
|
||||
// WRITEME: Check if fee is adequate
|
||||
if (txnFee == 0)
|
||||
return terINSUF_FEE_P;
|
||||
return tenINSUF_FEE_P;
|
||||
}
|
||||
}
|
||||
|
||||
// get source account ID
|
||||
uint160 srcAccount = txn.getSourceAccount().getAccountID();
|
||||
if (!srcAccount) return terINVALID;
|
||||
if (!srcAccount) return tenINVALID;
|
||||
|
||||
boost::recursive_mutex::scoped_lock sl(mLedger->mLock);
|
||||
|
||||
@@ -118,7 +118,7 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran
|
||||
switch(txn.getTxnType())
|
||||
{
|
||||
case ttINVALID:
|
||||
result = terINVALID;
|
||||
result = tenINVALID;
|
||||
break;
|
||||
|
||||
case ttCLAIM:
|
||||
@@ -138,7 +138,7 @@ TransactionEngineResult TransactionEngine::applyTransaction(const SerializedTran
|
||||
break;
|
||||
|
||||
default:
|
||||
result = terUNKNOWN;
|
||||
result = tenUNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ TransactionEngineResult TransactionEngine::doClaim(const SerializedTransaction&
|
||||
|
||||
if (sourceAccountID != txn.getSourceAccount().getAccountID())
|
||||
// Signing Pub Key must be for Source Account ID.
|
||||
return terINVALID;
|
||||
return tenINVALID;
|
||||
|
||||
LedgerStateParms qry = lepNONE;
|
||||
SerializedLedgerEntry::pointer dest = mLedger->getAccountRoot(qry, sourceAccountID);
|
||||
@@ -194,14 +194,14 @@ TransactionEngineResult TransactionEngine::doClaim(const SerializedTransaction&
|
||||
|
||||
if (dest->getIFieldPresent(sfAuthorizedKey))
|
||||
// Source account already claimed.
|
||||
return terCLAIMED;
|
||||
return tenCLAIMED;
|
||||
|
||||
uint160 hGeneratorID = txn.getITFieldH160(sfGeneratorID);
|
||||
qry = lepNONE;
|
||||
SerializedLedgerEntry::pointer gen = mLedger->getGenerator(qry, hGeneratorID);
|
||||
if (gen)
|
||||
// Generator is already in use. Regular passphrases limited to one wallet.
|
||||
return terGEN_IN_USE;
|
||||
return tenGEN_IN_USE;
|
||||
|
||||
//
|
||||
// Claim the account.
|
||||
@@ -232,7 +232,7 @@ TransactionEngineResult TransactionEngine::doPayment(const SerializedTransaction
|
||||
uint160 destAccount = txn.getITFieldAccount(sfDestination);
|
||||
|
||||
// Does the destination account exist?
|
||||
if (!destAccount) return terINVALID;
|
||||
if (!destAccount) return tenINVALID;
|
||||
LedgerStateParms qry = lepNONE;
|
||||
SerializedLedgerEntry::pointer dest = mLedger->getAccountRoot(qry, destAccount);
|
||||
if (!dest)
|
||||
@@ -265,7 +265,7 @@ TransactionEngineResult TransactionEngine::doPayment(const SerializedTransaction
|
||||
else
|
||||
{
|
||||
// WRITEME: Handle non-native currencies, paths
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
|
||||
return terSUCCESS;
|
||||
@@ -274,36 +274,36 @@ TransactionEngineResult TransactionEngine::doPayment(const SerializedTransaction
|
||||
TransactionEngineResult TransactionEngine::doInvoice(const SerializedTransaction& txn,
|
||||
std::vector<AffectedAccount>& accounts)
|
||||
{
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::doOffer(const SerializedTransaction& txn,
|
||||
std::vector<AffectedAccount>& accounts)
|
||||
{
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::doTake(const SerializedTransaction& txn,
|
||||
std::vector<AffectedAccount>& accounts)
|
||||
{
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::doCancel(const SerializedTransaction& txn,
|
||||
std::vector<AffectedAccount>& accounts)
|
||||
{
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::doStore(const SerializedTransaction& txn,
|
||||
std::vector<AffectedAccount>& accounts)
|
||||
{
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
|
||||
TransactionEngineResult TransactionEngine::doDelete(const SerializedTransaction& txn,
|
||||
std::vector<AffectedAccount>& accounts)
|
||||
{
|
||||
return terUNKNOWN;
|
||||
return tenUNKNOWN;
|
||||
}
|
||||
// vim:ts=4
|
||||
|
||||
@@ -11,14 +11,18 @@
|
||||
// It can also, verify signatures, verify fees, and give rejection reasons
|
||||
|
||||
enum TransactionEngineResult
|
||||
{ // <0 = Can never succeed, 0 = success, >0 = failed, but could succeed
|
||||
terGEN_IN_USE = -6, // Generator already in use.
|
||||
terCLAIMED = -5, // Can not claim a previously claimed account.
|
||||
terFAILED = -4, // Something broke horribly
|
||||
terUNKNOWN = -3, // The transactions requires logic not implemented yet
|
||||
terINSUF_FEE_P = -2, // fee totally insufficient
|
||||
terINVALID = -1, // The transaction is ill-formed
|
||||
{
|
||||
// tenCAN_NEVER_SUCCEED = <0
|
||||
tenGEN_IN_USE = -100, // Generator already in use.
|
||||
tenCLAIMED, // Can not claim a previously claimed account.
|
||||
tenFAILED, // Something broke horribly
|
||||
tenUNKNOWN, // The transactions requires logic not implemented yet
|
||||
tenINSUF_FEE_P, // fee totally insufficient
|
||||
tenINVALID, // The transaction is ill-formed
|
||||
|
||||
terSUCCESS = 0, // The transaction was applied
|
||||
|
||||
// terFAILED_BUT_COULD_SUCEED = >0
|
||||
terALREADY, // The transaction was already in the ledger
|
||||
terNO_ACCOUNT, // The source account does not exist
|
||||
terNO_TARGET, // The destination does not exist
|
||||
|
||||
Reference in New Issue
Block a user