Clean this up in preparation for cleaning the fee logic.

This commit is contained in:
David Schwartz
2013-07-25 10:49:16 -07:00
parent 7fbc44a866
commit fed9cce242

View File

@@ -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)