mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Fix compiler warning.
This commit is contained in:
@@ -15,11 +15,11 @@ Transactor::pointer Transactor::makeTransactor(const SerializedTransaction& txn,
|
|||||||
{
|
{
|
||||||
switch(txn.getTxnType())
|
switch(txn.getTxnType())
|
||||||
{
|
{
|
||||||
case ttPAYMENT:
|
case ttPAYMENT:
|
||||||
return( Transactor::pointer(new PaymentTransactor(txn,params,engine)) );
|
return( Transactor::pointer(new PaymentTransactor(txn,params,engine)) );
|
||||||
case ttACCOUNT_SET:
|
case ttACCOUNT_SET:
|
||||||
return( Transactor::pointer(new AccountSetTransactor(txn,params,engine)) );
|
return( Transactor::pointer(new AccountSetTransactor(txn,params,engine)) );
|
||||||
case ttREGULAR_KEY_SET:
|
case ttREGULAR_KEY_SET:
|
||||||
return( Transactor::pointer(new RegularKeySetTransactor(txn,params,engine)) );
|
return( Transactor::pointer(new RegularKeySetTransactor(txn,params,engine)) );
|
||||||
case ttTRUST_SET:
|
case ttTRUST_SET:
|
||||||
return( Transactor::pointer(new TrustSetTransactor(txn,params,engine)) );
|
return( Transactor::pointer(new TrustSetTransactor(txn,params,engine)) );
|
||||||
@@ -35,14 +35,11 @@ Transactor::pointer Transactor::makeTransactor(const SerializedTransaction& txn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Transactor::Transactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) : mTxn(txn), mParams(params), mEngine(engine)
|
Transactor::Transactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) : mTxn(txn), mEngine(engine), mParams(params)
|
||||||
{
|
{
|
||||||
mHasAuthKey=false;
|
mHasAuthKey=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Transactor::calculateFee()
|
void Transactor::calculateFee()
|
||||||
{
|
{
|
||||||
mFeeDue = theConfig.FEE_DEFAULT;
|
mFeeDue = theConfig.FEE_DEFAULT;
|
||||||
@@ -61,7 +58,7 @@ TER Transactor::payFee()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !saPaid ) return tesSUCCESS;
|
if( !saPaid ) return tesSUCCESS;
|
||||||
|
|
||||||
// Deduct the fee, so it's not available during the transaction.
|
// Deduct the fee, so it's not available during the transaction.
|
||||||
// Will only write the account back, if the transaction succeeds.
|
// Will only write the account back, if the transaction succeeds.
|
||||||
if (mSourceBalance < saPaid)
|
if (mSourceBalance < saPaid)
|
||||||
@@ -73,12 +70,11 @@ TER Transactor::payFee()
|
|||||||
|
|
||||||
return terINSUF_FEE_B;
|
return terINSUF_FEE_B;
|
||||||
}
|
}
|
||||||
|
|
||||||
mSourceBalance -= saPaid;
|
mSourceBalance -= saPaid;
|
||||||
mTxnAccount->setFieldAmount(sfBalance, mSourceBalance);
|
mTxnAccount->setFieldAmount(sfBalance, mSourceBalance);
|
||||||
|
|
||||||
return tesSUCCESS;
|
|
||||||
|
|
||||||
|
return tesSUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +104,7 @@ TER Transactor::checkSig()
|
|||||||
|
|
||||||
return temBAD_AUTH_MASTER;
|
return temBAD_AUTH_MASTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tesSUCCESS;
|
return tesSUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,11 +129,10 @@ TER Transactor::checkSeq()
|
|||||||
if (mEngine->getLedger()->hasTransaction(txID))
|
if (mEngine->getLedger()->hasTransaction(txID))
|
||||||
return tefALREADY;
|
return tefALREADY;
|
||||||
}
|
}
|
||||||
|
|
||||||
cLog(lsWARNING) << "applyTransaction: past sequence number";
|
cLog(lsWARNING) << "applyTransaction: past sequence number";
|
||||||
|
|
||||||
return tefPAST_SEQ;
|
return tefPAST_SEQ;
|
||||||
|
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
mTxnAccount->setFieldU32(sfSequence, t_seq + 1);
|
mTxnAccount->setFieldU32(sfSequence, t_seq + 1);
|
||||||
@@ -209,12 +204,13 @@ TER Transactor::apply()
|
|||||||
|
|
||||||
terResult=checkSig();
|
terResult=checkSig();
|
||||||
if(terResult != tesSUCCESS) return(terResult);
|
if(terResult != tesSUCCESS) return(terResult);
|
||||||
|
|
||||||
terResult=checkSeq();
|
terResult=checkSeq();
|
||||||
if(terResult != tesSUCCESS) return(terResult);
|
if(terResult != tesSUCCESS) return(terResult);
|
||||||
|
|
||||||
mEngine->entryModify(mTxnAccount);
|
mEngine->entryModify(mTxnAccount);
|
||||||
|
|
||||||
return doApply();
|
return doApply();
|
||||||
|
}
|
||||||
}
|
|
||||||
|
// vim:ts=4
|
||||||
|
|||||||
Reference in New Issue
Block a user