Check if synchronized in ripple_path_find

If a call to ripple_path_find does not specify a ledger,
the call should fail if the server is not synchronized
to the network.
This commit is contained in:
David Schwartz
2015-07-10 10:45:17 -07:00
committed by Vinnie Falco
parent de6f678de7
commit 3078c6da12

View File

@@ -19,6 +19,7 @@
#include <BeastConfig.h>
#include <ripple/rpc/RipplePathFind.h>
#include <ripple/rpc/impl/Tuning.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/paths/AccountCurrencies.h>
#include <ripple/app/paths/FindPaths.h>
@@ -79,6 +80,12 @@ Json::Value doRipplePathFind (RPC::Context& context)
}
else
{
if (getApp().getLedgerMaster().getValidatedLedgerAge() >
RPC::Tuning::maxValidatedLedgerAge)
{
return rpcError (rpcNO_NETWORK);
}
context.loadType = Resource::feeHighBurdenRPC;
lpLedger = context.netOps.getClosedLedger();