add gateway_balances. fix bug with account_currencies

This commit is contained in:
CJ Cobb
2021-09-10 17:41:00 -04:00
parent 01aed9f6e8
commit f18c8f67e2
9 changed files with 266 additions and 70 deletions

View File

@@ -105,6 +105,7 @@ static std::unordered_map<std::string, std::function<Result(Context const&)>>
{"account_objects", &doAccountObjects},
{"account_offers", &doAccountOffers},
{"account_tx", &doAccountTx},
{"gateway_balances", &doGatewayBalances},
{"book_offers", &doBookOffers},
{"channel_authorize", &doChannelAuthorize},
{"channel_verify", &doChannelVerify},
@@ -145,6 +146,10 @@ shouldForwardToRippled(Context const& ctx)
}
}
if (ctx.method == "account_info" && request.contains("queue") &&
request.at("queue").as_bool())
return true;
return false;
}
@@ -152,7 +157,12 @@ Result
buildResponse(Context const& ctx)
{
if (shouldForwardToRippled(ctx))
return ctx.balancer->forwardToRippled(ctx.params);
{
auto res = ctx.balancer->forwardToRippled(ctx.params);
if (res.size() == 0)
return Status{Error::rpcFAILED_TO_FORWARD};
return res;
}
if (handlerTable.find(ctx.method) == handlerTable.end())
return Status{Error::rpcUNKNOWN_COMMAND};