TxQ full queue RPC info (RIPD-1404):

* RPC `ledger` command returns all queue entries in "queue_data"
  when requesting open ledger, and including boolean "queue: true".
  * Includes queue state. e.g.: fee_level, retries, last_result, tx.
  * Respects "expand" and "binary" parameters for the txs.
* Remove some unused code.
This commit is contained in:
Edward Hennis
2017-02-13 21:21:28 -05:00
committed by Scott Schurr
parent 846723d771
commit 7265729446
14 changed files with 499 additions and 204 deletions

View File

@@ -92,7 +92,6 @@ class HandlerTable {
h.valueMethod_ = &handle<Json::Value, HandlerImpl>;
h.role_ = HandlerImpl::role();
h.condition_ = HandlerImpl::condition();
h.objectMethod_ = &handle<Json::Object, HandlerImpl>;
table_[HandlerImpl::name()] = h;
};

View File

@@ -48,7 +48,6 @@ struct Handler
Method<Json::Value> valueMethod_;
Role role_;
RPC::Condition condition_;
Method<Json::Object> objectMethod_;
};
const Handler* getHandler (std::string const&);

View File

@@ -265,36 +265,6 @@ Status doCommand (
return rpcUNKNOWN_COMMAND;
}
/** Execute an RPC command and store the results in a string. */
void executeRPC (
RPC::Context& context, std::string& output)
{
boost::optional <Handler const&> handler;
if (auto error = fillHandler (context, handler))
{
auto wo = Json::stringWriterObject (output);
auto&& sub = Json::addObject (*wo, jss::result);
inject_error (error, sub);
}
else if (auto method = handler->objectMethod_)
{
auto wo = Json::stringWriterObject (output);
getResult (context, method, *wo, handler->name_);
}
else if (auto method = handler->valueMethod_)
{
auto object = Json::Value (Json::objectValue);
getResult (context, method, object, handler->name_);
output = to_string (object);
}
else
{
// Can't ever get here.
assert (false);
Throw<std::logic_error> ("RPC handler with no method");
}
}
Role roleRequired (std::string const& method)
{
auto handler = RPC::getHandler(method);

View File

@@ -434,14 +434,13 @@ transactionPreProcessImpl (
*ledger);
// If the account has any txs in the TxQ, skip those sequence
// numbers (accounting for possible gaps).
if(queued)
for(auto const& tx : *queued)
{
if (tx.first == seq)
++seq;
else if (tx.first > seq)
break;
}
for(auto const& tx : queued)
{
if (tx.first == seq)
++seq;
else if (tx.first > seq)
break;
}
tx_json[jss::Sequence] = seq;
}