mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Cleanup.
This commit is contained in:
@@ -127,28 +127,23 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
|
|||||||
uint32 t_seq = txn.getSequence();
|
uint32 t_seq = txn.getSequence();
|
||||||
uint32 a_seq = txnAcct->getFieldU32(sfSequence);
|
uint32 a_seq = txnAcct->getFieldU32(sfSequence);
|
||||||
|
|
||||||
if (t_seq != a_seq)
|
if (a_seq < t_seq)
|
||||||
{
|
terResult = terPRE_SEQ;
|
||||||
if (a_seq < t_seq)
|
else if (a_seq > t_seq)
|
||||||
terResult = terPRE_SEQ;
|
terResult = tefPAST_SEQ;
|
||||||
else
|
|
||||||
terResult = tefPAST_SEQ;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
STAmount fee = txn.getTransactionFee();
|
STAmount fee = txn.getTransactionFee();
|
||||||
STAmount balance = txnAcct->getFieldAmount(sfBalance);
|
STAmount balance = txnAcct->getFieldAmount(sfBalance);
|
||||||
|
|
||||||
if (balance < fee)
|
if (balance < fee)
|
||||||
{
|
|
||||||
terResult = terINSUF_FEE_B;
|
terResult = terINSUF_FEE_B;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
txnAcct->setFieldAmount(sfBalance, balance - fee);
|
txnAcct->setFieldAmount(sfBalance, balance - fee);
|
||||||
txnAcct->setFieldU32(sfSequence, t_seq + 1);
|
txnAcct->setFieldU32(sfSequence, t_seq + 1);
|
||||||
didApply = true;
|
|
||||||
entryModify(txnAcct);
|
entryModify(txnAcct);
|
||||||
|
didApply = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user