diff --git a/src/ripple/app/tx/Transaction.cpp b/src/ripple/app/tx/Transaction.cpp index fac6c63ee..c2d7ca54f 100644 --- a/src/ripple/app/tx/Transaction.cpp +++ b/src/ripple/app/tx/Transaction.cpp @@ -189,18 +189,4 @@ Json::Value Transaction::getJson (int options, bool binary) const return ret; } -bool Transaction::isHexTxID (std::string const& txid) -{ - if (txid.size () != 64) - return false; - - auto const ret = std::find_if (txid.begin (), txid.end (), - [](std::string::value_type c) - { - return !std::isxdigit (c); - }); - - return (ret == txid.end ()); -} - } // ripple diff --git a/src/ripple/app/tx/Transaction.h b/src/ripple/app/tx/Transaction.h index d1694e871..7c4626000 100644 --- a/src/ripple/app/tx/Transaction.h +++ b/src/ripple/app/tx/Transaction.h @@ -119,8 +119,6 @@ public: static Transaction::pointer load (uint256 const& id); - static bool isHexTxID (std::string const&); - private: uint256 mTransactionID; RippleAddress mAccountFrom; diff --git a/src/ripple/rpc/handlers/Tx.cpp b/src/ripple/rpc/handlers/Tx.cpp index 98f2efba8..a874578dd 100644 --- a/src/ripple/rpc/handlers/Tx.cpp +++ b/src/ripple/rpc/handlers/Tx.cpp @@ -25,6 +25,23 @@ namespace ripple { // { // transaction: // } + +static +bool +isHexTxID (std::string const& txid) +{ + if (txid.size () != 64) + return false; + + auto const ret = std::find_if (txid.begin (), txid.end (), + [](std::string::value_type c) + { + return !std::isxdigit (c); + }); + + return (ret == txid.end ()); +} + Json::Value doTx (RPC::Context& context) { if (!context.params.isMember (jss::transaction)) @@ -35,7 +52,7 @@ Json::Value doTx (RPC::Context& context) auto const txid = context.params[jss::transaction].asString (); - if (!Transaction::isHexTxID (txid)) + if (!isHexTxID (txid)) return rpcError (rpcNOT_IMPL); auto txn = getApp().getMasterTransaction ().fetch (uint256 (txid), true);