mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Clean this up in preparation for cleaning the fee logic.
This commit is contained in:
@@ -106,6 +106,7 @@ Json::Value RPCHandler::transactionSign (Json::Value params, bool bSubmit, bool
|
||||
{
|
||||
return rpcError (rpcINVALID_PARAMS);
|
||||
}
|
||||
std::string sType = txJSON["TransactionType"].asString ();
|
||||
|
||||
Ledger::pointer lSnapshot = mNetOps->getCurrentSnapshot ();
|
||||
AccountState::pointer asSrc = bOffline
|
||||
@@ -122,7 +123,19 @@ Json::Value RPCHandler::transactionSign (Json::Value params, bool bSubmit, bool
|
||||
return rpcError (rpcSRC_ACT_NOT_FOUND);
|
||||
}
|
||||
|
||||
if ("Payment" == txJSON["TransactionType"].asString ())
|
||||
if (!txJSON.isMember ("Fee")
|
||||
&& (
|
||||
"AccountSet" == sType
|
||||
|| "Payment" == sType
|
||||
|| "OfferCreate" == sType
|
||||
|| "OfferCancel" == sType
|
||||
|| "TrustSet" == sType))
|
||||
{
|
||||
// feeReq = lSnapshot->scaleFeeLoad(,
|
||||
txJSON["Fee"] = (int) theConfig.FEE_DEFAULT;
|
||||
}
|
||||
|
||||
if ("Payment" == sType)
|
||||
{
|
||||
|
||||
RippleAddress dstAccountID;
|
||||
@@ -137,11 +150,6 @@ Json::Value RPCHandler::transactionSign (Json::Value params, bool bSubmit, bool
|
||||
return rpcError (rpcDST_ACT_MALFORMED);
|
||||
}
|
||||
|
||||
if (!txJSON.isMember ("Fee"))
|
||||
{
|
||||
txJSON["Fee"] = (int) theConfig.FEE_DEFAULT;
|
||||
}
|
||||
|
||||
if (txJSON.isMember ("Paths") && params.isMember ("build_path"))
|
||||
{
|
||||
// Asking to build a path when providing one is an error.
|
||||
@@ -205,16 +213,6 @@ Json::Value RPCHandler::transactionSign (Json::Value params, bool bSubmit, bool
|
||||
}
|
||||
}
|
||||
|
||||
if (!txJSON.isMember ("Fee")
|
||||
&& (
|
||||
"AccountSet" == txJSON["TransactionType"].asString ()
|
||||
|| "OfferCreate" == txJSON["TransactionType"].asString ()
|
||||
|| "OfferCancel" == txJSON["TransactionType"].asString ()
|
||||
|| "TrustSet" == txJSON["TransactionType"].asString ()))
|
||||
{
|
||||
txJSON["Fee"] = (int) theConfig.FEE_DEFAULT;
|
||||
}
|
||||
|
||||
if (!txJSON.isMember ("Sequence"))
|
||||
{
|
||||
if (bOffline)
|
||||
|
||||
Reference in New Issue
Block a user