Skip to content

Commit

Permalink
[FOLD] Address undertome's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelportilla committed Feb 14, 2020
1 parent 37d1a62 commit d56bab8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/ripple/app/main/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void printHelp (const po::options_description& desc)
" connect <ip> [<port>]\n"
" consensus_info\n"
" deposit_authorized <source_account> <destination_account> [<ledger>]\n"
" download_shard [[<index> <url>]] <validate>\n"
" download_shard [[<index> <url>]]\n"
" feature [<feature> [accept|reject]]\n"
" fetch_info [clear]\n"
" gateway_balances [<ledger>] <issuer_account> [ <hotwallet> [ <hotwallet> ]]\n"
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/net/impl/RPCCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class RPCParser
++i;
else if (!boost::iequals(jvParams[--sz].asString(), "novalidate"))
return rpcError(rpcINVALID_PARAMS);
jvResult[jss::validate] = false;
// jvResult[jss::validate] = false;
}

// Create the 'shards' array
Expand Down
6 changes: 3 additions & 3 deletions src/ripple/nodestore/impl/DatabaseShardImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ DatabaseShardImp::init()

Config const& config {app_.config()};
Section const& section {config.section(ConfigSection::shardDatabase())};
if (section.empty())
return fail("missing configuration");

{
// Node and shard stores must use same earliest ledger sequence
Expand Down Expand Up @@ -1273,20 +1271,22 @@ DatabaseShardImp::setFileStats()

std::uint64_t sumSz {0};
std::uint32_t sumFd {0};
std::uint32_t numShards {0};
for (auto const& wptr : wptrShards)
{
if (auto shard {wptr.lock()}; shard)
{
auto[sz, fd] = shard->fileInfo();
sumSz += sz;
sumFd += fd;
++numShards;
}
}

std::lock_guard lock(mutex_);
fileSz_ = sumSz;
fdRequired_ = sumFd;
avgShardFileSz_ = fileSz_ / wptrShards.size();
avgShardFileSz_ = fileSz_ / numShards;

if (fileSz_ >= maxFileSz_)
{
Expand Down
1 change: 0 additions & 1 deletion src/ripple/protocol/jss.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ JSS ( url_password ); // in: Subscribe
JSS ( url_username ); // in: Subscribe
JSS ( urlgravatar ); //
JSS ( username ); // in: Subscribe
JSS ( validate ); // in: DownloadShard
JSS ( validated ); // out: NetworkOPs, RPCHelpers, AccountTx*
// Tx
JSS ( validator_list_expires ); // out: NetworkOps, ValidatorList
Expand Down
15 changes: 5 additions & 10 deletions src/test/rpc/RPCCall_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2980,10 +2980,9 @@ static RPCCallTestData const rpcCallTestArray [] =
})"
},
{
"download_shard: novalidate.", __LINE__,
"download_shard:", __LINE__,
{
"download_shard",
"novalidate",
"20",
"url_NotValidated",
},
Expand All @@ -2998,8 +2997,7 @@ static RPCCallTestData const rpcCallTestArray [] =
"index" : 20,
"url" : "url_NotValidated"
}
],
"validate" : false
]
}
]
})"
Expand Down Expand Up @@ -3046,10 +3044,9 @@ static RPCCallTestData const rpcCallTestArray [] =
})"
},
{
"download_shard: novalidate many shards.", __LINE__,
"download_shard: many shards.", __LINE__,
{
"download_shard",
"novalidate",
"2000000",
"url_NotValidated0",
"2000001",
Expand Down Expand Up @@ -3088,8 +3085,7 @@ static RPCCallTestData const rpcCallTestArray [] =
"index" : 2000004,
"url" : "url_NotValidated4"
}
],
"validate" : false
]
}
]
})"
Expand Down Expand Up @@ -3142,8 +3138,7 @@ static RPCCallTestData const rpcCallTestArray [] =
"index" : 20,
"url" : "url_NotValidated"
}
],
"validate" : false
]
}
]
})"
Expand Down

0 comments on commit d56bab8

Please sign in to comment.