mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 17:56:49 +00:00
chore: More fixes for bad renames (#7092)
This commit is contained in:
@@ -273,7 +273,7 @@ Logs::toString(LogSeverity s)
|
||||
return "Fatal";
|
||||
// LCOV_EXCL_START
|
||||
default:
|
||||
UNREACHABLE("xrpl::Logs::to_string : invalid severity");
|
||||
UNREACHABLE("xrpl::Logs::toString : invalid severity");
|
||||
return "Unknown";
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
void
|
||||
doStop(CompletionCounter)
|
||||
{
|
||||
XRPL_ASSERT(stop_called == true, "xrpl::ResolverAsioImpl::do_stop : stopping");
|
||||
XRPL_ASSERT(stop_called == true, "xrpl::ResolverAsioImpl::doStop : stopping");
|
||||
|
||||
if (!stopped.exchange(true))
|
||||
{
|
||||
@@ -369,7 +369,7 @@ public:
|
||||
void
|
||||
doResolve(std::vector<std::string> const& names, HandlerType const& handler, CompletionCounter)
|
||||
{
|
||||
XRPL_ASSERT(!names.empty(), "xrpl::ResolverAsioImpl::do_resolve : names non-empty");
|
||||
XRPL_ASSERT(!names.empty(), "xrpl::ResolverAsioImpl::doResolve : names non-empty");
|
||||
|
||||
if (!stop_called)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ static_assert(std::atomic<std::chrono::steady_clock::rep>::is_always_lock_free);
|
||||
SecondsClockThread::~SecondsClockThread()
|
||||
{
|
||||
XRPL_ASSERT(
|
||||
thread_.joinable(), "beast::seconds_clock_thread::~seconds_clock_thread : thread joinable");
|
||||
thread_.joinable(), "beast::SecondsClockThread::~SecondsClockThread : thread joinable");
|
||||
{
|
||||
std::scoped_lock const lock(mut_);
|
||||
stop_ = true;
|
||||
|
||||
@@ -54,14 +54,14 @@ const_iterator::operator==(ConstIterator const& other) const
|
||||
|
||||
XRPL_ASSERT(
|
||||
view_ == other.view_ && root_.key == other.root_.key,
|
||||
"xrpl::const_iterator::operator== : views and roots are matching");
|
||||
"xrpl::Dir::ConstIterator::operator== : views and roots are matching");
|
||||
return page_.key == other.page_.key && index_ == other.index_;
|
||||
}
|
||||
|
||||
const_iterator::reference
|
||||
const_iterator::operator*() const
|
||||
{
|
||||
XRPL_ASSERT(index_ != beast::kZERO, "xrpl::const_iterator::operator* : nonzero index");
|
||||
XRPL_ASSERT(index_ != beast::kZERO, "xrpl::Dir::ConstIterator::operator* : nonzero index");
|
||||
if (!cache_)
|
||||
cache_ = view_->read(keylet::child(index_));
|
||||
return *cache_;
|
||||
@@ -70,7 +70,7 @@ const_iterator::operator*() const
|
||||
const_iterator&
|
||||
const_iterator::operator++()
|
||||
{
|
||||
XRPL_ASSERT(index_ != beast::kZERO, "xrpl::const_iterator::operator++ : nonzero index");
|
||||
XRPL_ASSERT(index_ != beast::kZERO, "xrpl::Dir::ConstIterator::operator++ : nonzero index");
|
||||
if (++it_ != std::end(*indexes_))
|
||||
{
|
||||
index_ = *it_;
|
||||
@@ -84,7 +84,8 @@ const_iterator::operator++()
|
||||
const_iterator
|
||||
const_iterator::operator++(int)
|
||||
{
|
||||
XRPL_ASSERT(index_ != beast::kZERO, "xrpl::const_iterator::operator++(int) : nonzero index");
|
||||
XRPL_ASSERT(
|
||||
index_ != beast::kZERO, "xrpl::Dir::ConstIterator::operator++(int) : nonzero index");
|
||||
ConstIterator tmp(*this);
|
||||
++(*this);
|
||||
return tmp;
|
||||
@@ -103,7 +104,7 @@ const_iterator::nextPage()
|
||||
{
|
||||
page_ = keylet::page(root_, next);
|
||||
sle_ = view_->read(page_);
|
||||
XRPL_ASSERT(sle_, "xrpl::const_iterator::next_page : non-null SLE");
|
||||
XRPL_ASSERT(sle_, "xrpl::Dir::ConstIterator::nextPage : non-null SLE");
|
||||
indexes_ = &sle_->getFieldV256(sfIndexes);
|
||||
if (indexes_->empty())
|
||||
{
|
||||
|
||||
@@ -287,7 +287,7 @@ quality(Keylet const& k, std::uint64_t q) noexcept
|
||||
Keylet
|
||||
NextT::operator()(Keylet const& k) const
|
||||
{
|
||||
XRPL_ASSERT(k.type == ltDIR_NODE, "xrpl::keylet::next_t::operator() : valid input type");
|
||||
XRPL_ASSERT(k.type == ltDIR_NODE, "xrpl::keylet::NextT::operator() : valid input type");
|
||||
return {ltDIR_NODE, getQualityNext(k.key)};
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +62,10 @@ ceilInImpl(Amounts const& amount, STAmount const& limit, bool roundUp, Quality c
|
||||
// Clamp out
|
||||
if (result.out > amount.out)
|
||||
result.out = amount.out;
|
||||
XRPL_ASSERT(result.in == limit, "xrpl::ceil_in_impl : result matches limit");
|
||||
XRPL_ASSERT(result.in == limit, "xrpl::ceilInImpl : result matches limit");
|
||||
return result;
|
||||
}
|
||||
XRPL_ASSERT(amount.in <= limit, "xrpl::ceil_in_impl : result inside limit");
|
||||
XRPL_ASSERT(amount.in <= limit, "xrpl::ceilInImpl : result inside limit");
|
||||
return amount;
|
||||
}
|
||||
|
||||
@@ -91,10 +91,10 @@ ceilOutImpl(Amounts const& amount, STAmount const& limit, bool roundUp, Quality
|
||||
// Clamp in
|
||||
if (result.in > amount.in)
|
||||
result.in = amount.in;
|
||||
XRPL_ASSERT(result.out == limit, "xrpl::ceil_out_impl : result matches limit");
|
||||
XRPL_ASSERT(result.out == limit, "xrpl::ceilOutImpl : result matches limit");
|
||||
return result;
|
||||
}
|
||||
XRPL_ASSERT(amount.out <= limit, "xrpl::ceil_out_impl : result inside limit");
|
||||
XRPL_ASSERT(amount.out <= limit, "xrpl::ceilOutImpl : result inside limit");
|
||||
return amount;
|
||||
}
|
||||
|
||||
@@ -114,10 +114,10 @@ Quality
|
||||
composedQuality(Quality const& lhs, Quality const& rhs)
|
||||
{
|
||||
STAmount const lhsRate(lhs.rate());
|
||||
XRPL_ASSERT(lhsRate != beast::kZERO, "xrpl::composed_quality : nonzero left input");
|
||||
XRPL_ASSERT(lhsRate != beast::kZERO, "xrpl::composedQuality : nonzero left input");
|
||||
|
||||
STAmount const rhsRate(rhs.rate());
|
||||
XRPL_ASSERT(rhsRate != beast::kZERO, "xrpl::composed_quality : nonzero right input");
|
||||
XRPL_ASSERT(rhsRate != beast::kZERO, "xrpl::composedQuality : nonzero right input");
|
||||
|
||||
STAmount const rate(mulRound(lhsRate, rhsRate, lhsRate.asset(), true));
|
||||
|
||||
@@ -125,7 +125,7 @@ composedQuality(Quality const& lhs, Quality const& rhs)
|
||||
std::uint64_t const storedMantissa(rate.mantissa());
|
||||
|
||||
XRPL_ASSERT(
|
||||
(storedExponent > 0) && (storedExponent <= 255), "xrpl::composed_quality : valid exponent");
|
||||
(storedExponent > 0) && (storedExponent <= 255), "xrpl::composedQuality : valid exponent");
|
||||
|
||||
return Quality((storedExponent << (64 - 8)) | storedMantissa);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ operator<<(std::ostream& os, Port const& p)
|
||||
|
||||
if (!p.secure_gateway_nets_v4.empty() || !p.secure_gateway_nets_v6.empty())
|
||||
{
|
||||
os << "secureGateway nets:";
|
||||
os << "secure_gateway nets:";
|
||||
for (auto const& net : p.secure_gateway_nets_v4)
|
||||
{
|
||||
os << net.to_string();
|
||||
|
||||
@@ -158,7 +158,7 @@ invokePreflight(PreflightContext const& ctx)
|
||||
// Should never happen
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx.j.fatal()) << "Unknown transaction type in preflight: " << e.txnType;
|
||||
UNREACHABLE("xrpl::invoke_preflight : unknown transaction type");
|
||||
UNREACHABLE("xrpl::invokePreflight : unknown transaction type");
|
||||
return {temUNKNOWN, TxConsequences{temUNKNOWN}};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
@@ -217,7 +217,7 @@ invokePreclaim(PreclaimContext const& ctx)
|
||||
// Should never happen
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx.j.fatal()) << "Unknown transaction type in preclaim: " << e.txnType;
|
||||
UNREACHABLE("xrpl::invoke_preclaim : unknown transaction type");
|
||||
UNREACHABLE("xrpl::invokePreclaim : unknown transaction type");
|
||||
return temUNKNOWN;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
@@ -307,7 +307,7 @@ invokeApply(ApplyContext& ctx)
|
||||
// Should never happen
|
||||
// LCOV_EXCL_START
|
||||
JLOG(ctx.journal.fatal()) << "Unknown transaction type in apply: " << e.txnType;
|
||||
UNREACHABLE("xrpl::invoke_apply : unknown transaction type");
|
||||
UNREACHABLE("xrpl::invokeApply : unknown transaction type");
|
||||
return {temUNKNOWN, false};
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
@@ -1420,8 +1420,8 @@ public:
|
||||
|
||||
uint8_t tag2[] = "hello world some ascii 32b long"; // including 1 byte for NUL
|
||||
|
||||
uint256 bogieTag = xrpl::BaseUint<256>::fromVoid(tag1);
|
||||
uint256 demonTag = xrpl::BaseUint<256>::fromVoid(tag2);
|
||||
uint256 bogieTag = xrpl::BaseUInt<256>::fromVoid(tag1);
|
||||
uint256 demonTag = xrpl::BaseUInt<256>::fromVoid(tag2);
|
||||
|
||||
// Attach phantom signers to alice and use them for a transaction.
|
||||
env(signers(alice, 1, {{bogie_, 1, bogieTag}, {demon_, 1, demonTag}}));
|
||||
|
||||
@@ -206,7 +206,7 @@ class Vault_test : public beast::unit_test::Suite
|
||||
{
|
||||
testcase(prefix + " fail to set domain on public vault");
|
||||
auto tx = vault.set({.owner = owner, .id = keylet.key});
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
env(tx, Ter{tecNO_PERMISSION});
|
||||
env.close();
|
||||
}
|
||||
@@ -678,14 +678,14 @@ class Vault_test : public beast::unit_test::Suite
|
||||
env(tx);
|
||||
|
||||
tx[sfFlags] = tx[sfFlags].asUInt() | tfVaultPrivate;
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
env(tx, Ter{temDISABLED});
|
||||
|
||||
{
|
||||
auto tx = vault.set({.owner = owner, .id = keylet.key});
|
||||
env(tx, kDATA("Test"));
|
||||
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(13ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(13ul));
|
||||
env(tx, Ter{temDISABLED});
|
||||
}
|
||||
},
|
||||
@@ -786,12 +786,12 @@ class Vault_test : public beast::unit_test::Suite
|
||||
testcase("disabled permissioned domain");
|
||||
|
||||
auto [tx, keylet] = vault.create({.owner = owner, .asset = xrpIssue()});
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
env(tx, Ter{temDISABLED});
|
||||
|
||||
{
|
||||
auto tx = vault.set({.owner = owner, .id = keylet.key});
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
env(tx, Ter{temDISABLED});
|
||||
}
|
||||
|
||||
@@ -1079,7 +1079,7 @@ class Vault_test : public beast::unit_test::Suite
|
||||
|
||||
{
|
||||
auto tx = tx1;
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
env(tx, Ter{temMALFORMED});
|
||||
}
|
||||
|
||||
@@ -1238,7 +1238,7 @@ class Vault_test : public beast::unit_test::Suite
|
||||
Vault& vault) {
|
||||
auto [tx, keylet] = vault.create({.owner = owner, .asset = asset});
|
||||
tx[sfFlags] = tfVaultPrivate;
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
testcase("non-existing domain");
|
||||
env(tx, Ter{tecOBJECT_NOT_FOUND});
|
||||
});
|
||||
@@ -3065,7 +3065,7 @@ class Vault_test : public beast::unit_test::Suite
|
||||
{
|
||||
testcase("private vault cannot set non-existing domain");
|
||||
auto tx = vault.set({.owner = owner, .id = keylet.key});
|
||||
tx[sfDomainID] = to_string(BaseUint<256>(42ul));
|
||||
tx[sfDomainID] = to_string(BaseUInt<256>(42ul));
|
||||
env(tx, Ter{tecOBJECT_NOT_FOUND});
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ struct Nonhash
|
||||
|
||||
struct base_uint_test : beast::unit_test::Suite
|
||||
{
|
||||
using test96 = BaseUint<96>;
|
||||
using test96 = BaseUInt<96>;
|
||||
static_assert(std::is_copy_constructible_v<test96>);
|
||||
static_assert(std::is_copy_assignable_v<test96>);
|
||||
|
||||
@@ -68,7 +68,7 @@ struct base_uint_test : beast::unit_test::Suite
|
||||
|
||||
for (auto const& arg : kTEST_ARGS)
|
||||
{
|
||||
xrpl::BaseUint<64> const u{arg.first}, v{arg.second};
|
||||
xrpl::BaseUInt<64> const u{arg.first}, v{arg.second};
|
||||
BEAST_EXPECT(u < v);
|
||||
BEAST_EXPECT(u <= v);
|
||||
BEAST_EXPECT(u != v);
|
||||
@@ -99,7 +99,7 @@ struct base_uint_test : beast::unit_test::Suite
|
||||
|
||||
for (auto const& arg : kTEST_ARGS)
|
||||
{
|
||||
xrpl::BaseUint<96> const u{arg.first}, v{arg.second};
|
||||
xrpl::BaseUInt<96> const u{arg.first}, v{arg.second};
|
||||
BEAST_EXPECT(u < v);
|
||||
BEAST_EXPECT(u <= v);
|
||||
BEAST_EXPECT(u != v);
|
||||
@@ -327,16 +327,16 @@ struct base_uint_test : beast::unit_test::Suite
|
||||
|
||||
// Verify that constexpr base_uints interpret a string the same
|
||||
// way parseHex() does.
|
||||
struct StrBaseUint
|
||||
struct StrBaseUInt
|
||||
{
|
||||
char const* const str;
|
||||
test96 tst;
|
||||
|
||||
constexpr StrBaseUint(char const* s) : str(s), tst(s)
|
||||
constexpr StrBaseUInt(char const* s) : str(s), tst(s)
|
||||
{
|
||||
}
|
||||
};
|
||||
constexpr StrBaseUint kTEST_CASES[] = {
|
||||
constexpr StrBaseUInt kTEST_CASES[] = {
|
||||
"000000000000000000000000",
|
||||
"000000000000000000000001",
|
||||
"fedcba9876543210ABCDEF91",
|
||||
@@ -344,7 +344,7 @@ struct base_uint_test : beast::unit_test::Suite
|
||||
"800000000000000000000000",
|
||||
"fFfFfFfFfFfFfFfFfFfFfFfF"};
|
||||
|
||||
for (StrBaseUint const& t : kTEST_CASES)
|
||||
for (StrBaseUInt const& t : kTEST_CASES)
|
||||
{
|
||||
test96 t96;
|
||||
BEAST_EXPECT(t96.parseHex(t.str));
|
||||
|
||||
@@ -112,7 +112,7 @@ class io_latency_probe_test : public beast::unit_test::Suite, public beast::test
|
||||
|
||||
struct TestSampler
|
||||
{
|
||||
beast::IoLatencyProbe<std::chrono::steady_clock> probe;
|
||||
beast::IOLatencyProbe<std::chrono::steady_clock> probe;
|
||||
std::vector<std::chrono::steady_clock::duration> durations;
|
||||
|
||||
TestSampler(std::chrono::milliseconds interval, boost::asio::io_context& ios)
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
auto const data =
|
||||
"00000000000000000000000055534400000000000000000000000000000000"
|
||||
"000000000000000000";
|
||||
BaseUint<320> uint;
|
||||
BaseUInt<320> uint;
|
||||
(void)uint.parseHex(data);
|
||||
SerialIter iter(Slice(uint.data(), uint.size()));
|
||||
STIssue const stissue(iter, sfAsset);
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
auto const data =
|
||||
"0000000000000000000000005553440000000000ae123a8556f3cf91154711"
|
||||
"376afb0f894f832b3d";
|
||||
BaseUint<320> uint;
|
||||
BaseUInt<320> uint;
|
||||
(void)uint.parseHex(data);
|
||||
SerialIter iter(Slice(uint.data(), uint.size()));
|
||||
STIssue const stissue(iter, sfAsset);
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
try
|
||||
{
|
||||
auto const data = "0000000000000000000000000000000000000000";
|
||||
BaseUint<160> uint;
|
||||
BaseUInt<160> uint;
|
||||
(void)uint.parseHex(data);
|
||||
SerialIter iter(Slice(uint.data(), uint.size()));
|
||||
STIssue const stissue(iter, sfAsset);
|
||||
|
||||
@@ -141,16 +141,16 @@ fixConfigPorts(Config& config, Endpoints const& endpoints);
|
||||
class ApplicationImp : public Application, public BasicApp
|
||||
{
|
||||
private:
|
||||
class IoLatencySampler
|
||||
class IOLatencySampler
|
||||
{
|
||||
private:
|
||||
beast::insight::Event event_;
|
||||
beast::Journal journal_;
|
||||
beast::IoLatencyProbe<std::chrono::steady_clock> probe_;
|
||||
beast::IOLatencyProbe<std::chrono::steady_clock> probe_;
|
||||
std::atomic<std::chrono::milliseconds> lastSample_;
|
||||
|
||||
public:
|
||||
IoLatencySampler(
|
||||
IOLatencySampler(
|
||||
beast::insight::Event ev,
|
||||
beast::Journal journal,
|
||||
std::chrono::milliseconds interval,
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
|
||||
std::unique_ptr<ResolverAsio> resolver_;
|
||||
|
||||
IoLatencySampler io_latency_sampler_;
|
||||
IOLatencySampler io_latency_sampler_;
|
||||
|
||||
std::unique_ptr<GRPCServer> grpcServer_;
|
||||
// NOLINTEND(readability-identifier-naming)
|
||||
|
||||
@@ -376,8 +376,8 @@ GRPCServerImpl::GRPCServerImpl(Application& app)
|
||||
if (addr.is_unspecified())
|
||||
{
|
||||
JLOG(journal_.error()) << "Can't pass unspecified IP in "
|
||||
<< "secureGateway section of port_grpc";
|
||||
Throw<std::runtime_error>("Unspecified IP in secureGateway section");
|
||||
<< "secure_gateway section of port_grpc";
|
||||
Throw<std::runtime_error>("Unspecified IP in secure_gateway section");
|
||||
}
|
||||
|
||||
secureGatewayIPs_.emplace_back(addr);
|
||||
@@ -386,7 +386,7 @@ GRPCServerImpl::GRPCServerImpl(Application& app)
|
||||
catch (std::exception const&)
|
||||
{
|
||||
JLOG(journal_.error()) << "Error parsing secure gateway IPs for grpc server";
|
||||
Throw<std::runtime_error>("Error parsing secureGateway section");
|
||||
Throw<std::runtime_error>("Error parsing secure_gateway section");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ toString(TableType type)
|
||||
return "AccountTransactions";
|
||||
// LCOV_EXCL_START
|
||||
default:
|
||||
UNREACHABLE("xrpl::detail::to_string : invalid TableType");
|
||||
UNREACHABLE("xrpl::detail::toString : invalid TableType");
|
||||
return "Unknown";
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ makeFeaturesResponseHeader(
|
||||
this topic, see https://github.com/openssl/openssl/issues/5509 and
|
||||
https://github.com/XRPLF/rippled/issues/2413.
|
||||
*/
|
||||
static std::optional<BaseUint<512>>
|
||||
static std::optional<BaseUInt<512>>
|
||||
hashLastMessage(SSL const* ssl, size_t (*get)(const SSL*, void*, size_t))
|
||||
{
|
||||
constexpr std::size_t kSSL_MINIMUM_FINISHED_LENGTH = 12;
|
||||
@@ -145,7 +145,7 @@ hashLastMessage(SSL const* ssl, size_t (*get)(const SSL*, void*, size_t))
|
||||
|
||||
sha512_hasher const h;
|
||||
|
||||
BaseUint<512> cookie;
|
||||
BaseUInt<512> cookie;
|
||||
SHA512(buf, len, cookie.data());
|
||||
return cookie;
|
||||
}
|
||||
|
||||
@@ -475,14 +475,14 @@ OverlayImpl::addActive(std::shared_ptr<PeerImp> const& peer)
|
||||
|
||||
{
|
||||
auto const result = peers_.emplace(peer->slot(), peer);
|
||||
XRPL_ASSERT(result.second, "xrpl::OverlayImpl::add_active : peer is inserted");
|
||||
XRPL_ASSERT(result.second, "xrpl::OverlayImpl::addActive : peer is inserted");
|
||||
(void)result.second;
|
||||
}
|
||||
|
||||
{
|
||||
auto const result = ids_.emplace(
|
||||
std::piecewise_construct, std::make_tuple(peer->id()), std::make_tuple(peer));
|
||||
XRPL_ASSERT(result.second, "xrpl::OverlayImpl::add_active : peer ID is inserted");
|
||||
XRPL_ASSERT(result.second, "xrpl::OverlayImpl::addActive : peer ID is inserted");
|
||||
(void)result.second;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ Bootcache::onSuccess(beast::IP::Endpoint const& endpoint)
|
||||
++entry.valence();
|
||||
map_.erase(result.first);
|
||||
result = map_.insert(value_type(endpoint, entry));
|
||||
XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::on_success : endpoint inserted");
|
||||
XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::onSuccess : endpoint inserted");
|
||||
}
|
||||
Entry const& entry(result.first->right);
|
||||
JLOG(journal_.info()) << beast::Leftw(18) << "Bootcache connect " << endpoint << " with "
|
||||
@@ -166,7 +166,7 @@ Bootcache::onFailure(beast::IP::Endpoint const& endpoint)
|
||||
--entry.valence();
|
||||
map_.erase(result.first);
|
||||
result = map_.insert(value_type(endpoint, entry));
|
||||
XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::on_failure : endpoint inserted");
|
||||
XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::onFailure : endpoint inserted");
|
||||
}
|
||||
Entry const& entry(result.first->right);
|
||||
auto const n(std::abs(entry.valence()));
|
||||
|
||||
@@ -23,7 +23,7 @@ template <class Target, class HopContainer>
|
||||
std::size_t
|
||||
handoutOne(Target& t, HopContainer& h)
|
||||
{
|
||||
XRPL_ASSERT(!t.full(), "xrpl::PeerFinder::detail::handout_one : target is not full");
|
||||
XRPL_ASSERT(!t.full(), "xrpl::PeerFinder::detail::handoutOne : target is not full");
|
||||
for (auto it = h.begin(); it != h.end(); ++it)
|
||||
{
|
||||
auto const& e = *it;
|
||||
|
||||
@@ -499,7 +499,7 @@ Livecache<Allocator>::HopsT::insert(Element& e)
|
||||
{
|
||||
XRPL_ASSERT(
|
||||
e.endpoint.hops <= Tuning::kMAX_HOPS + 1,
|
||||
"xrpl::PeerFinder::Livecache::hops_t::insert : maximum input hops");
|
||||
"xrpl::PeerFinder::Livecache::HopsT::insert : maximum input hops");
|
||||
// This has security implications without a shuffle
|
||||
lists_[e.endpoint.hops].push_front(e);
|
||||
++hist_[e.endpoint.hops];
|
||||
@@ -511,7 +511,7 @@ Livecache<Allocator>::HopsT::reinsert(Element& e, std::uint32_t numHops)
|
||||
{
|
||||
XRPL_ASSERT(
|
||||
numHops <= Tuning::kMAX_HOPS + 1,
|
||||
"xrpl::PeerFinder::Livecache::hops_t::reinsert : maximum hops input");
|
||||
"xrpl::PeerFinder::Livecache::HopsT::reinsert : maximum hops input");
|
||||
|
||||
auto& list = lists_[e.endpoint.hops];
|
||||
list.erase(list.iterator_to(e));
|
||||
|
||||
@@ -745,12 +745,12 @@ public:
|
||||
// The object must exist in our table
|
||||
XRPL_ASSERT(
|
||||
slots.contains(slot->remoteEndpoint()),
|
||||
"xrpl::PeerFinder::Logic::on_endpoints : valid slot input");
|
||||
"xrpl::PeerFinder::Logic::onEndpoints : valid slot input");
|
||||
|
||||
// Must be handshaked!
|
||||
XRPL_ASSERT(
|
||||
slot->state() == Slot::State::Active,
|
||||
"xrpl::PeerFinder::Logic::on_endpoints : valid slot state");
|
||||
"xrpl::PeerFinder::Logic::onEndpoints : valid slot state");
|
||||
|
||||
clock_type::time_point const now(clock.now());
|
||||
|
||||
@@ -762,7 +762,7 @@ public:
|
||||
|
||||
for (auto const& ep : list)
|
||||
{
|
||||
XRPL_ASSERT(ep.hops, "xrpl::PeerFinder::Logic::on_endpoints : nonzero hops");
|
||||
XRPL_ASSERT(ep.hops, "xrpl::PeerFinder::Logic::onEndpoints : nonzero hops");
|
||||
|
||||
slot->recent.insert(ep.address, ep.hops);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user