mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +00:00
Add two more files to module ripple_ledger
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
#include "src/cpp/ripple/AccountState.h"
|
#include "src/cpp/ripple/AccountState.h"
|
||||||
#include "src/cpp/ripple/Application.h"
|
#include "src/cpp/ripple/Application.h"
|
||||||
#include "src/cpp/ripple/BitcoinUtil.h"
|
#include "src/cpp/ripple/BitcoinUtil.h"
|
||||||
|
#include "src/cpp/ripple/CanonicalTXSet.h"
|
||||||
#include "src/cpp/ripple/ChangeTransactor.h"
|
#include "src/cpp/ripple/ChangeTransactor.h"
|
||||||
#include "src/cpp/ripple/Config.h"
|
#include "src/cpp/ripple/Config.h"
|
||||||
#include "src/cpp/ripple/Contract.h"
|
#include "src/cpp/ripple/Contract.h"
|
||||||
@@ -150,6 +151,8 @@
|
|||||||
|
|
||||||
// transactions
|
// transactions
|
||||||
#include "src/cpp/ripple/AccountSetTransactor.cpp"
|
#include "src/cpp/ripple/AccountSetTransactor.cpp"
|
||||||
|
#include "src/cpp/ripple/ChangeTransactor.cpp" // no log
|
||||||
|
#include "src/cpp/ripple/CanonicalTXSet.cpp"
|
||||||
#include "src/cpp/ripple/OfferCancelTransactor.cpp"
|
#include "src/cpp/ripple/OfferCancelTransactor.cpp"
|
||||||
#include "src/cpp/ripple/OfferCreateTransactor.cpp"
|
#include "src/cpp/ripple/OfferCreateTransactor.cpp"
|
||||||
#include "src/cpp/ripple/PaymentTransactor.cpp"
|
#include "src/cpp/ripple/PaymentTransactor.cpp"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
|
|
||||||
#include "CanonicalTXSet.h"
|
|
||||||
|
|
||||||
bool CanonicalTXKey::operator<(const CanonicalTXKey& key) const
|
bool CanonicalTXKey::operator<(const CanonicalTXKey& key) const
|
||||||
{
|
{
|
||||||
if (mAccount < key.mAccount) return true;
|
if (mAccount < key.mAccount) return true;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
#include "ChangeTransactor.h"
|
|
||||||
#include "Log.h"
|
|
||||||
|
|
||||||
SETUP_LOG();
|
|
||||||
|
|
||||||
TER ChangeTransactor::doApply()
|
TER ChangeTransactor::doApply()
|
||||||
{
|
{
|
||||||
@@ -18,13 +14,13 @@ TER ChangeTransactor::checkSig()
|
|||||||
{
|
{
|
||||||
if (mTxn.getFieldAccount160(sfAccount).isNonZero())
|
if (mTxn.getFieldAccount160(sfAccount).isNonZero())
|
||||||
{
|
{
|
||||||
cLog(lsWARNING) << "Change transaction had bad source account";
|
WriteLog (lsWARNING, ChangeTransactor) << "Change transaction had bad source account";
|
||||||
return temBAD_SRC_ACCOUNT;
|
return temBAD_SRC_ACCOUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mTxn.getSigningPubKey().empty() || !mTxn.getSignature().empty())
|
if (!mTxn.getSigningPubKey().empty() || !mTxn.getSignature().empty())
|
||||||
{
|
{
|
||||||
cLog(lsWARNING) << "Change transaction had bad signature";
|
WriteLog (lsWARNING, ChangeTransactor) << "Change transaction had bad signature";
|
||||||
return temBAD_SIGNATURE;
|
return temBAD_SIGNATURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +31,7 @@ TER ChangeTransactor::checkSeq()
|
|||||||
{
|
{
|
||||||
if ((mTxn.getSequence() != 0) || mTxn.isFieldPresent(sfPreviousTxnID))
|
if ((mTxn.getSequence() != 0) || mTxn.isFieldPresent(sfPreviousTxnID))
|
||||||
{
|
{
|
||||||
cLog(lsWARNING) << "Change transaction had bad sequence";
|
WriteLog (lsWARNING, ChangeTransactor) << "Change transaction had bad sequence";
|
||||||
return temBAD_SEQUENCE;
|
return temBAD_SEQUENCE;
|
||||||
}
|
}
|
||||||
return tesSUCCESS;
|
return tesSUCCESS;
|
||||||
@@ -45,7 +41,7 @@ TER ChangeTransactor::payFee()
|
|||||||
{
|
{
|
||||||
if (mTxn.getTransactionFee() != STAmount())
|
if (mTxn.getTransactionFee() != STAmount())
|
||||||
{
|
{
|
||||||
cLog(lsWARNING) << "Change transaction with non-zero fee";
|
WriteLog (lsWARNING, ChangeTransactor) << "Change transaction with non-zero fee";
|
||||||
return temBAD_FEE;
|
return temBAD_FEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,14 +53,14 @@ TER ChangeTransactor::preCheck()
|
|||||||
mTxnAccountID = mTxn.getSourceAccount().getAccountID();
|
mTxnAccountID = mTxn.getSourceAccount().getAccountID();
|
||||||
if (mTxnAccountID.isNonZero())
|
if (mTxnAccountID.isNonZero())
|
||||||
{
|
{
|
||||||
cLog(lsWARNING) << "applyTransaction: bad source id";
|
WriteLog (lsWARNING, ChangeTransactor) << "applyTransaction: bad source id";
|
||||||
|
|
||||||
return temBAD_SRC_ACCOUNT;
|
return temBAD_SRC_ACCOUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSetBit(mParams, tapOPEN_LEDGER))
|
if (isSetBit(mParams, tapOPEN_LEDGER))
|
||||||
{
|
{
|
||||||
cLog(lsWARNING) << "Change transaction against open ledger";
|
WriteLog (lsWARNING, ChangeTransactor) << "Change transaction against open ledger";
|
||||||
return temINVALID;
|
return temINVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +93,7 @@ TER ChangeTransactor::applyFee()
|
|||||||
if (!feeObject)
|
if (!feeObject)
|
||||||
feeObject = mEngine->entryCreate(ltFEE_SETTINGS, Ledger::getLedgerFeeIndex());
|
feeObject = mEngine->entryCreate(ltFEE_SETTINGS, Ledger::getLedgerFeeIndex());
|
||||||
|
|
||||||
cLog(lsINFO) << "Previous fee object: " << feeObject->getJson(0);
|
WriteLog (lsINFO, ChangeTransactor) << "Previous fee object: " << feeObject->getJson(0);
|
||||||
|
|
||||||
feeObject->setFieldU64(sfBaseFee, mTxn.getFieldU64(sfBaseFee));
|
feeObject->setFieldU64(sfBaseFee, mTxn.getFieldU64(sfBaseFee));
|
||||||
feeObject->setFieldU32(sfReferenceFeeUnits, mTxn.getFieldU32(sfReferenceFeeUnits));
|
feeObject->setFieldU32(sfReferenceFeeUnits, mTxn.getFieldU32(sfReferenceFeeUnits));
|
||||||
@@ -106,7 +102,7 @@ TER ChangeTransactor::applyFee()
|
|||||||
|
|
||||||
mEngine->entryModify(feeObject);
|
mEngine->entryModify(feeObject);
|
||||||
|
|
||||||
cLog(lsINFO) << "New fee object: " << feeObject->getJson(0);
|
WriteLog (lsINFO, ChangeTransactor) << "New fee object: " << feeObject->getJson(0);
|
||||||
cLog(lsWARNING) << "Fees have been changed";
|
WriteLog (lsWARNING, ChangeTransactor) << "Fees have been changed";
|
||||||
return tesSUCCESS;
|
return tesSUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user