mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-23 15:10:34 +00:00
roll back unrelated clang-tidy changes
This commit is contained in:
@@ -15,7 +15,7 @@ namespace xrpl {
|
||||
class Buffer
|
||||
{
|
||||
private:
|
||||
std::unique_ptr<std::uint8_t[]> p_{};
|
||||
std::unique_ptr<std::uint8_t[]> p_;
|
||||
std::size_t size_ = 0;
|
||||
|
||||
public:
|
||||
|
||||
@@ -41,7 +41,7 @@ struct LocalValues
|
||||
};
|
||||
|
||||
// Keys are the address of a LocalValue.
|
||||
std::unordered_map<void const*, std::unique_ptr<BasicValue>> values{};
|
||||
std::unordered_map<void const*, std::unique_ptr<BasicValue>> values;
|
||||
|
||||
static void
|
||||
cleanup(LocalValues* lvs)
|
||||
|
||||
@@ -105,7 +105,7 @@ fromString(RangeSet<T>& rs, std::string const& s)
|
||||
{
|
||||
std::vector<std::string> intervals;
|
||||
std::vector<std::string> tokens;
|
||||
bool const result{true};
|
||||
bool result{true};
|
||||
|
||||
rs.clear();
|
||||
boost::split(tokens, s, boost::algorithm::is_any_of(","));
|
||||
|
||||
@@ -197,7 +197,7 @@ private:
|
||||
class KeyOnlyEntry
|
||||
{
|
||||
public:
|
||||
clock_type::time_point lastAccess{};
|
||||
clock_type::time_point lastAccess;
|
||||
|
||||
explicit KeyOnlyEntry(clock_type::time_point const& lastAccess) : lastAccess(lastAccess)
|
||||
{
|
||||
@@ -214,7 +214,7 @@ private:
|
||||
{
|
||||
public:
|
||||
shared_weak_combo_pointer_type ptr;
|
||||
clock_type::time_point lastAccess{};
|
||||
clock_type::time_point lastAccess;
|
||||
|
||||
ValueEntry(clock_type::time_point const& lastAccess, shared_pointer_type const& ptr)
|
||||
: ptr(ptr), lastAccess(lastAccess)
|
||||
@@ -289,11 +289,11 @@ private:
|
||||
int const targetSize_;
|
||||
|
||||
// Desired maximum cache age
|
||||
clock_type::duration const targetAge_{};
|
||||
clock_type::duration const targetAge_;
|
||||
|
||||
// Number of items cached
|
||||
int cacheCount_{0};
|
||||
cache_type cache_{}; // Hold strong reference to recent objects
|
||||
cache_type cache_; // Hold strong reference to recent objects
|
||||
std::uint64_t hits_{0};
|
||||
std::uint64_t misses_{0};
|
||||
};
|
||||
|
||||
@@ -232,7 +232,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
|
||||
|
||||
std::vector<std::thread> workers;
|
||||
workers.reserve(cache_.partitions());
|
||||
std::atomic<int> const allRemovals = 0;
|
||||
std::atomic<int> allRemovals = 0;
|
||||
|
||||
for (std::size_t p = 0; p < cache_.partitions(); ++p)
|
||||
{
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
{
|
||||
}
|
||||
|
||||
value_type value{};
|
||||
value_type value;
|
||||
time_point when;
|
||||
};
|
||||
|
||||
@@ -493,7 +493,7 @@ private:
|
||||
|
||||
private:
|
||||
float maxLoadFactor_;
|
||||
vec_type vec{};
|
||||
vec_type vec_;
|
||||
};
|
||||
|
||||
template <class... Args>
|
||||
@@ -1446,7 +1446,7 @@ private:
|
||||
private:
|
||||
ConfigT config_;
|
||||
Buckets buck_;
|
||||
cont_type mutable cont_{};
|
||||
cont_type mutable cont_;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,7 +72,7 @@ struct LexicalCast<Out, std::string_view>
|
||||
bool
|
||||
operator()(bool& out, std::string_view in) const
|
||||
{
|
||||
std::string const result;
|
||||
std::string result;
|
||||
|
||||
// Convert the input to lowercase
|
||||
std::transform(in.begin(), in.end(), std::back_inserter(result), [](auto c) {
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] NodePtr
|
||||
NodePtr
|
||||
node() const
|
||||
{
|
||||
return node_;
|
||||
|
||||
@@ -200,8 +200,8 @@ class ListIterator
|
||||
{
|
||||
using iter_type = boost::string_ref::const_iterator;
|
||||
|
||||
iter_type it_{};
|
||||
iter_type end_{};
|
||||
iter_type it_;
|
||||
iter_type end_;
|
||||
boost::string_ref value_;
|
||||
|
||||
public:
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace beast::unit_test::detail {
|
||||
namespace beast::unit_test {
|
||||
|
||||
namespace detail {
|
||||
|
||||
/** A simple test runner that writes everything to a stream in real time.
|
||||
The totals are output when the object is destroyed.
|
||||
@@ -66,7 +68,7 @@ private:
|
||||
std::size_t cases = 0;
|
||||
std::size_t total = 0;
|
||||
std::size_t failed = 0;
|
||||
std::vector<run_time> top{};
|
||||
std::vector<run_time> top;
|
||||
typename clock_type::time_point start = clock_type::now();
|
||||
|
||||
void
|
||||
@@ -244,6 +246,8 @@ Reporter<Unused>::onLog(std::string const& s)
|
||||
os_ << s;
|
||||
}
|
||||
|
||||
} // namespace beast::unit_test::detail
|
||||
} // namespace detail
|
||||
|
||||
using reporter = detail::Reporter<>;
|
||||
|
||||
} // namespace beast::unit_test
|
||||
|
||||
@@ -41,8 +41,8 @@ private:
|
||||
TestsT() = default;
|
||||
|
||||
/** Returns the total number of test conditions. */
|
||||
static [[nodiscard]] std::size_t
|
||||
total()
|
||||
[[nodiscard]] std::size_t
|
||||
total() const
|
||||
{
|
||||
return cont().size();
|
||||
}
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
}
|
||||
|
||||
/** Register a successful test condition. */
|
||||
static void
|
||||
void
|
||||
pass()
|
||||
{
|
||||
cont().emplace_back(true);
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
{
|
||||
public:
|
||||
/** Insert a string into the log. */
|
||||
static void
|
||||
void
|
||||
insert(std::string const& s)
|
||||
{
|
||||
cont().push_back(s);
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
Text sent to the log output stream will be forwarded to
|
||||
the output stream associated with the runner.
|
||||
*/
|
||||
LogOs<char> log{};
|
||||
LogOs<char> log;
|
||||
|
||||
/** Memberspace for declaring test cases. */
|
||||
TestcaseT testcase;
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
std::uint32_t cost;
|
||||
|
||||
/** For compound conditions, set of conditions includes */
|
||||
std::set<Type> subtypes{};
|
||||
std::set<Type> subtypes;
|
||||
|
||||
Condition(Type t, std::uint32_t c, Slice fp) : type(t), fingerprint(fp), cost(c)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ JobQueue::Coro::expectEarlyExit()
|
||||
inline void
|
||||
JobQueue::Coro::join()
|
||||
{
|
||||
std::unique_lock<std::mutex> const lk(mutexRun_);
|
||||
std::unique_lock<std::mutex> lk(mutexRun_);
|
||||
cv_.wait(lk, [this]() { return !running_; });
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ enum class HashRouterFlags : std::uint16_t {
|
||||
constexpr HashRouterFlags
|
||||
operator|(HashRouterFlags lhs, HashRouterFlags rhs)
|
||||
{
|
||||
return (lhs) | static_cast<std::underlying_type_t<HashRouterFlags>>(rhs);
|
||||
return static_cast<HashRouterFlags>(
|
||||
static_cast<std::underlying_type_t<HashRouterFlags>>(lhs) |
|
||||
static_cast<std::underlying_type_t<HashRouterFlags>>(rhs));
|
||||
}
|
||||
|
||||
constexpr HashRouterFlags&
|
||||
@@ -45,7 +47,9 @@ operator|=(HashRouterFlags& lhs, HashRouterFlags rhs)
|
||||
constexpr HashRouterFlags
|
||||
operator&(HashRouterFlags lhs, HashRouterFlags rhs)
|
||||
{
|
||||
return (lhs) & static_cast<std::underlying_type_t<HashRouterFlags>>(rhs);
|
||||
return static_cast<HashRouterFlags>(
|
||||
static_cast<std::underlying_type_t<HashRouterFlags>>(lhs) &
|
||||
static_cast<std::underlying_type_t<HashRouterFlags>>(rhs));
|
||||
}
|
||||
|
||||
constexpr HashRouterFlags&
|
||||
@@ -127,7 +131,7 @@ private:
|
||||
}
|
||||
|
||||
/** Return set of peers we've relayed to and reset tracking */
|
||||
static std::set<PeerShortID>
|
||||
std::set<PeerShortID>
|
||||
releasePeerSet()
|
||||
{
|
||||
return std::move(peers_);
|
||||
@@ -146,25 +150,31 @@ private:
|
||||
If it has, return false. If it has not, update the
|
||||
last relay timestamp and return true.
|
||||
*/
|
||||
static bool
|
||||
bool
|
||||
shouldRelay(Stopwatch::time_point const& now, std::chrono::seconds relayTime)
|
||||
{
|
||||
return !relayed_ && *relayed_ + relayTime > now;
|
||||
if (relayed_ && *relayed_ + relayTime > now)
|
||||
return false;
|
||||
relayed_.emplace(now);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
bool
|
||||
shouldProcess(Stopwatch::time_point now, std::chrono::seconds interval)
|
||||
{
|
||||
return !processed_ && ((*processed_ + interval) > now);
|
||||
if (processed_ && ((*processed_ + interval) > now))
|
||||
return false;
|
||||
processed_.emplace(now);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
HashRouterFlags flags_ = HashRouterFlags::UNDEFINED;
|
||||
std::set<PeerShortID> peers_{};
|
||||
std::set<PeerShortID> peers_;
|
||||
// This could be generalized to a map, if more
|
||||
// than one flag needs to expire independently.
|
||||
std::optional<Stopwatch::time_point> relayed_{};
|
||||
std::optional<Stopwatch::time_point> processed_{};
|
||||
std::optional<Stopwatch::time_point> relayed_;
|
||||
std::optional<Stopwatch::time_point> processed_;
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -241,7 +251,7 @@ private:
|
||||
|
||||
// Stores all suppressed hashes and their expiration time
|
||||
beast::aged_unordered_map<uint256, Entry, Stopwatch::clock_type, HardenedHash<strong_hash>>
|
||||
suppressionMap_{};
|
||||
suppressionMap_;
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
std::mutex mutexRun_;
|
||||
std::condition_variable cv_;
|
||||
boost::coroutines2::coroutine<void>::push_type* yield_{};
|
||||
boost::coroutines2::coroutine<void>::pull_type coro_{};
|
||||
boost::coroutines2::coroutine<void>::pull_type coro_;
|
||||
#ifndef NDEBUG
|
||||
bool finished_ = false;
|
||||
#endif
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
resume();
|
||||
|
||||
/** Returns true if the Coro is still runnable (has not returned). */
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
runnable() const;
|
||||
|
||||
/** Once called, the Coro allows early exit without an assert. */
|
||||
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
}
|
||||
|
||||
JobTypeInfo unknown;
|
||||
Map map{};
|
||||
Map map;
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
std::vector<PeerReservation>
|
||||
list() const;
|
||||
|
||||
static bool
|
||||
bool
|
||||
contains(PublicKey const& nodeId)
|
||||
{
|
||||
std::scoped_lock const lock(this->mutex_);
|
||||
@@ -95,7 +95,7 @@ private:
|
||||
beast::Journal mutable journal_;
|
||||
std::mutex mutable mutex_;
|
||||
DatabaseCon* connection_{};
|
||||
std::unordered_set<PeerReservation, beast::Uhash<>, KeyEqual> table_{};
|
||||
std::unordered_set<PeerReservation, beast::Uhash<>, KeyEqual> table_;
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
// implementation. These APIs will merge when the view code
|
||||
// supports a full ledger API
|
||||
|
||||
static void
|
||||
void
|
||||
doVoting(
|
||||
std::shared_ptr<ReadView const> const& lastClosedLedger,
|
||||
std::vector<std::shared_ptr<STValidation>> const& parentValidations,
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
obj.setFieldU32(sfFlags, it.second);
|
||||
});
|
||||
|
||||
Serializer const s;
|
||||
Serializer s;
|
||||
amendTx.add(s);
|
||||
|
||||
JLOG(j.debug()) << "Amendments: Adding pseudo-transaction: "
|
||||
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
bool
|
||||
dirRemove(Keylet const& directory, std::uint64_t page, uint256 const& key, bool keepRoot);
|
||||
|
||||
static bool
|
||||
bool
|
||||
dirRemove(Keylet const& directory, std::uint64_t page, Keylet const& key, bool keepRoot)
|
||||
{
|
||||
return dirRemove(directory, page, key.key, keepRoot);
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
private:
|
||||
std::recursive_mutex lock_;
|
||||
|
||||
hash_map<std::uint64_t, InfoSub::wptr> listeners_{};
|
||||
hash_map<std::uint64_t, InfoSub::wptr> listeners_;
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -17,7 +17,7 @@ private:
|
||||
DigestAwareReadView const& base_;
|
||||
CachedSLEs& cache_;
|
||||
std::mutex mutable mutex_;
|
||||
std::unordered_map<key_type, uint256, HardenedHash<>> mutable map_{};
|
||||
std::unordered_map<key_type, uint256, HardenedHash<>> mutable map_;
|
||||
|
||||
public:
|
||||
CachedViewImpl() = delete;
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<Key, std::shared_ptr<STTx const>> map_{};
|
||||
std::map<Key, std::shared_ptr<STTx const>> map_;
|
||||
|
||||
// Used to salt the accounts so people can't mine for low account numbers
|
||||
uint256 salt_;
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
OpenView(ReadView const* base, std::shared_ptr<void const> hold = nullptr);
|
||||
|
||||
/** Returns true if this reflects an open ledger. */
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
open() const override
|
||||
{
|
||||
return open_;
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
This is used to set the "apply ordinal"
|
||||
when calculating transaction metadata.
|
||||
*/
|
||||
[[nodiscard]] std::size_t
|
||||
std::size_t
|
||||
txCount() const;
|
||||
|
||||
/** Apply changes. */
|
||||
@@ -182,43 +182,43 @@ public:
|
||||
|
||||
// ReadView
|
||||
|
||||
[[nodiscard]] LedgerHeader const&
|
||||
LedgerHeader const&
|
||||
header() const override;
|
||||
|
||||
[[nodiscard]] Fees const&
|
||||
Fees const&
|
||||
fees() const override;
|
||||
|
||||
[[nodiscard]] Rules const&
|
||||
Rules const&
|
||||
rules() const override;
|
||||
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
exists(Keylet const& k) const override;
|
||||
|
||||
[[nodiscard]] std::optional<key_type>
|
||||
std::optional<key_type>
|
||||
succ(key_type const& key, std::optional<key_type> const& last = std::nullopt) const override;
|
||||
|
||||
[[nodiscard]] SLE::const_pointer
|
||||
SLE::const_pointer
|
||||
read(Keylet const& k) const override;
|
||||
|
||||
[[nodiscard]] std::unique_ptr<SlesType::iter_base>
|
||||
std::unique_ptr<SlesType::iter_base>
|
||||
slesBegin() const override;
|
||||
|
||||
[[nodiscard]] std::unique_ptr<SlesType::iter_base>
|
||||
std::unique_ptr<SlesType::iter_base>
|
||||
slesEnd() const override;
|
||||
|
||||
[[nodiscard]] std::unique_ptr<SlesType::iter_base>
|
||||
std::unique_ptr<SlesType::iter_base>
|
||||
slesUpperBound(uint256 const& key) const override;
|
||||
|
||||
[[nodiscard]] std::unique_ptr<TxsType::iter_base>
|
||||
std::unique_ptr<TxsType::iter_base>
|
||||
txsBegin() const override;
|
||||
|
||||
[[nodiscard]] std::unique_ptr<TxsType::iter_base>
|
||||
std::unique_ptr<TxsType::iter_base>
|
||||
txsEnd() const override;
|
||||
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
txExists(key_type const& key) const override;
|
||||
|
||||
[[nodiscard]] tx_type
|
||||
tx_type
|
||||
txRead(key_type const& key) const override;
|
||||
|
||||
// RawView
|
||||
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
struct IssuerValueMPT
|
||||
{
|
||||
IssuerValueMPT() = default;
|
||||
std::map<AccountID, HolderValueMPT> holders{};
|
||||
std::map<AccountID, HolderValueMPT> holders;
|
||||
// Credit to holder
|
||||
std::uint64_t credit = 0;
|
||||
// OutstandingAmount might overflow when MPTs are credited to a holder.
|
||||
@@ -114,9 +114,9 @@ private:
|
||||
static KeyIOU
|
||||
makeKeyIOU(AccountID const& a1, AccountID const& a2, Currency const& currency);
|
||||
|
||||
std::map<KeyIOU, ValueIOU> creditsIOU_{};
|
||||
std::map<MPTID, IssuerValueMPT> creditsMPT_{};
|
||||
std::map<AccountID, std::uint32_t> ownerCounts_{};
|
||||
std::map<KeyIOU, ValueIOU> creditsIOU_;
|
||||
std::map<MPTID, IssuerValueMPT> creditsMPT_;
|
||||
std::map<AccountID, std::uint32_t> ownerCounts_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -65,7 +65,9 @@ public:
|
||||
ReadView&
|
||||
operator=(ReadView const& other) = delete;
|
||||
|
||||
ReadView() : sles(*this), txs(*this) = default;
|
||||
ReadView() : sles(*this), txs(*this)
|
||||
{
|
||||
}
|
||||
|
||||
ReadView(ReadView const& other) : sles(*this), txs(*this)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ private:
|
||||
|
||||
using items_t = std::map<key_type, std::pair<Action, SLE::pointer>>;
|
||||
|
||||
items_t items_{};
|
||||
items_t items_;
|
||||
XRPAmount dropsDestroyed_{0};
|
||||
|
||||
public:
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
RawStateTable()
|
||||
: monotonicResource_{std::make_unique<boost::container::pmr::monotonic_buffer_resource>(
|
||||
kInitialBufferSize)}
|
||||
, items_{monotonicResource_.get()} = default;
|
||||
, items_{monotonicResource_.get()} {};
|
||||
|
||||
RawStateTable(RawStateTable const& rhs)
|
||||
: monotonicResource_{std::make_unique<boost::container::pmr::monotonic_buffer_resource>(
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
boost::container::pmr::polymorphic_allocator<std::pair<key_type const, SleAction>>>;
|
||||
// monotonic_resource_ must outlive `items_`. Make a pointer so it may be
|
||||
// easily moved.
|
||||
std::unique_ptr<boost::container::pmr::monotonic_buffer_resource> monotonicResource_{};
|
||||
std::unique_ptr<boost::container::pmr::monotonic_buffer_resource> monotonicResource_;
|
||||
items_t items_;
|
||||
|
||||
XRPAmount dropsDestroyed_{0};
|
||||
|
||||
@@ -217,7 +217,7 @@ protected:
|
||||
// advanced tunable, via the config file. The default value is 4.
|
||||
int const requestBundle_;
|
||||
|
||||
static void
|
||||
void
|
||||
storeStats(std::uint64_t count, std::uint64_t sz)
|
||||
{
|
||||
XRPL_ASSERT(count <= sz, "xrpl::NodeStore::Database::storeStats : valid inputs");
|
||||
|
||||
@@ -89,8 +89,8 @@ public:
|
||||
[[nodiscard]] constexpr value_type const&
|
||||
value() const;
|
||||
|
||||
static [[nodiscard]] constexpr token_type
|
||||
token();
|
||||
[[nodiscard]] constexpr token_type
|
||||
token() const;
|
||||
|
||||
void
|
||||
setJson(json::Value& jv) const;
|
||||
@@ -111,16 +111,16 @@ public:
|
||||
return detail::visit(issue_, std::forward<Visitors>(visitors)...);
|
||||
}
|
||||
|
||||
static [[nodiscard]] constexpr bool
|
||||
native()
|
||||
[[nodiscard]] constexpr bool
|
||||
native() const
|
||||
{
|
||||
return visit(
|
||||
[&](Issue const& issue) { return issue.native(); },
|
||||
[&](MPTIssue const&) { return false; });
|
||||
}
|
||||
|
||||
static [[nodiscard]] bool
|
||||
integral()
|
||||
[[nodiscard]] bool
|
||||
integral() const
|
||||
{
|
||||
return visit(
|
||||
[&](Issue const& issue) { return issue.native(); },
|
||||
@@ -192,16 +192,16 @@ Asset::value() const
|
||||
return issue_;
|
||||
}
|
||||
|
||||
static constexpr Asset::token_type
|
||||
Asset::token()
|
||||
constexpr Asset::token_type
|
||||
Asset::token() const
|
||||
{
|
||||
return visit(
|
||||
[&](Issue const& issue) -> Asset::token_type { return issue.currency; },
|
||||
[&](MPTIssue const& issue) -> Asset::token_type { return issue.getMptID(); });
|
||||
}
|
||||
|
||||
static constexpr Asset::AmtType
|
||||
Asset::getAmountType()
|
||||
constexpr Asset::AmtType
|
||||
Asset::getAmountType() const
|
||||
{
|
||||
return visit(
|
||||
[&](Issue const& issue) -> Asset::AmtType {
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
value_type
|
||||
operator()(argument_type const& value) const
|
||||
{
|
||||
value_type result(currency_hash_type::member(value.currency)) = 0;
|
||||
value_type result(currency_hash_type::member(value.currency));
|
||||
if (!isXRP(value.currency))
|
||||
boost::hash_combine(result, issuer_hash_type::member(value.account));
|
||||
return result;
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
value_type
|
||||
operator()(argument_type const& value) const
|
||||
{
|
||||
value_type const result(id_hash_type::member(value.getMptID())) = 0;
|
||||
value_type const result(id_hash_type::member(value.getMptID()));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
@@ -151,11 +151,11 @@ public:
|
||||
{
|
||||
return asset.visit(
|
||||
[&](xrpl::Issue const& issue) {
|
||||
value_type const result(mIssueHasher_(issue)) = 0;
|
||||
value_type const result(mIssueHasher_(issue));
|
||||
return result;
|
||||
},
|
||||
[&](xrpl::MPTIssue const& issue) {
|
||||
value_type const result(mMptissueHasher_(issue)) = 0;
|
||||
value_type const result(mMptissueHasher_(issue));
|
||||
return result;
|
||||
});
|
||||
}
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
value_type
|
||||
operator()(argument_type const& value) const
|
||||
{
|
||||
value_type result(issueHasher_(value.in)) = 0;
|
||||
value_type result(issueHasher_(value.in));
|
||||
boost::hash_combine(result, issueHasher_(value.out));
|
||||
|
||||
if (value.domain)
|
||||
|
||||
@@ -19,7 +19,7 @@ struct LedgerHeader
|
||||
//
|
||||
|
||||
LedgerIndex seq = 0;
|
||||
NetClock::time_point parentCloseTime{};
|
||||
NetClock::time_point parentCloseTime;
|
||||
|
||||
//
|
||||
// For closed ledgers
|
||||
@@ -49,7 +49,7 @@ struct LedgerHeader
|
||||
// closed. For open ledgers, the time the ledger
|
||||
// will close if there's no transactions.
|
||||
//
|
||||
NetClock::time_point closeTime{};
|
||||
NetClock::time_point closeTime;
|
||||
};
|
||||
|
||||
// ledger close flags
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace xrpl {
|
||||
class MPTIssue
|
||||
{
|
||||
private:
|
||||
MPTID mptID_{};
|
||||
MPTID mptID_;
|
||||
|
||||
public:
|
||||
MPTIssue() = default;
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl::detail {
|
||||
namespace xrpl {
|
||||
|
||||
namespace detail {
|
||||
template <typename T>
|
||||
constexpr bool kIsIntegralConstant = false;
|
||||
template <typename I, auto A>
|
||||
@@ -182,8 +184,10 @@ struct MultiApiJson
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace xrpl::detail
|
||||
} // namespace detail
|
||||
|
||||
// Wrapper for Json for all supported API versions.
|
||||
using MultiApiJson =
|
||||
detail::MultiApiJson<RPC::kApiMinimumSupportedVersion, RPC::kApiMaximumValidVersion>;
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace xrpl {
|
||||
class PathAsset
|
||||
{
|
||||
private:
|
||||
std::variant<Currency, MPTID> easset_{};
|
||||
std::variant<Currency, MPTID> easset_;
|
||||
|
||||
public:
|
||||
PathAsset() = default;
|
||||
@@ -27,8 +27,8 @@ public:
|
||||
[[nodiscard]] constexpr bool
|
||||
holds() const;
|
||||
|
||||
static [[nodiscard]] constexpr bool
|
||||
isXRP();
|
||||
[[nodiscard]] constexpr bool
|
||||
isXRP() const;
|
||||
|
||||
template <ValidPathAsset T>
|
||||
T const&
|
||||
@@ -87,7 +87,7 @@ PathAsset::value() const
|
||||
}
|
||||
|
||||
constexpr bool
|
||||
PathAsset::isXRP()
|
||||
PathAsset::isXRP() const
|
||||
{
|
||||
return visit(
|
||||
[&](Currency const& currency) { return xrpl::isXRP(currency); },
|
||||
|
||||
@@ -38,8 +38,8 @@ class SOElement
|
||||
SOETxMPTIssue supportMpt_ = SoeMptNone;
|
||||
|
||||
private:
|
||||
static void
|
||||
init(SField const& fieldName)
|
||||
void
|
||||
init(SField const& fieldName) const
|
||||
{
|
||||
if (!sField_.get().isUseful())
|
||||
{
|
||||
|
||||
@@ -556,12 +556,12 @@ STAmount::fromNumber(A const& a, Number const& number)
|
||||
if (asset.integral())
|
||||
{
|
||||
std::uint64_t const intValue = static_cast<std::int64_t>(working);
|
||||
return STAmount{asset, static_cast<uint32_t>(intValue), 0, negative};
|
||||
return STAmount{asset, intValue, 0, negative};
|
||||
}
|
||||
|
||||
auto const [mantissa, exponent] = working.normalizeToRange<kMinValue, kMaxValue>();
|
||||
|
||||
return STAmount{asset, static_cast<uint32_t>(mantissa), exponent, negative};
|
||||
return STAmount{asset, mantissa, exponent, negative};
|
||||
}
|
||||
|
||||
inline void
|
||||
|
||||
@@ -10,7 +10,7 @@ class STArray final : public STBase, public CountedObject<STArray>
|
||||
private:
|
||||
using list_type = std::vector<STObject>;
|
||||
|
||||
list_type v_{};
|
||||
list_type v_;
|
||||
|
||||
public:
|
||||
using value_type = STObject;
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
pushBack(object);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||
push_back(STObject&& object)
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
[[nodiscard]] value_type const&
|
||||
value() const noexcept;
|
||||
|
||||
static void
|
||||
setIssue(Asset const& issue) const;
|
||||
void
|
||||
setIssue(Asset const& issue);
|
||||
|
||||
[[nodiscard]] SerializedTypeID
|
||||
getSType() const override;
|
||||
@@ -114,7 +114,7 @@ STIssue::value() const noexcept
|
||||
}
|
||||
|
||||
inline void
|
||||
STIssue::setIssue(Asset const& asset) const
|
||||
STIssue::setIssue(Asset const& asset)
|
||||
{
|
||||
if (holds<Issue>() && !isConsistent(asset_.get<Issue>()))
|
||||
Throw<std::runtime_error>("Invalid asset: currency and account native mismatch");
|
||||
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
|
||||
class STPath final : public CountedObject<STPath>
|
||||
{
|
||||
std::vector<STPathElement> path_{};
|
||||
std::vector<STPathElement> path_;
|
||||
|
||||
public:
|
||||
STPath() = default;
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
// A set of zero or more payment paths
|
||||
class STPathSet final : public STBase, public CountedObject<STPathSet>
|
||||
{
|
||||
std::vector<STPath> value_{};
|
||||
std::vector<STPath> value_;
|
||||
|
||||
public:
|
||||
STPathSet() = default;
|
||||
|
||||
@@ -51,51 +51,51 @@ public:
|
||||
STTx(TxType type, std::function<void(STObject&)> assembler);
|
||||
|
||||
// STObject functions.
|
||||
[[nodiscard]] SerializedTypeID
|
||||
SerializedTypeID
|
||||
getSType() const override;
|
||||
|
||||
[[nodiscard]] std::string
|
||||
std::string
|
||||
getFullText() const override;
|
||||
|
||||
// Outer transaction functions / signature functions.
|
||||
static Blob
|
||||
getSignature(STObject const& sigObject);
|
||||
|
||||
[[nodiscard]] Blob
|
||||
Blob
|
||||
getSignature() const
|
||||
{
|
||||
return getSignature(*this);
|
||||
}
|
||||
|
||||
[[nodiscard]] uint256
|
||||
uint256
|
||||
getSigningHash() const;
|
||||
|
||||
[[nodiscard]] TxType
|
||||
TxType
|
||||
getTxnType() const;
|
||||
|
||||
[[nodiscard]] Blob
|
||||
Blob
|
||||
getSigningPubKey() const;
|
||||
|
||||
[[nodiscard]] SeqProxy
|
||||
SeqProxy
|
||||
getSeqProxy() const;
|
||||
|
||||
/** Returns the first non-zero value of (Sequence, TicketSequence). */
|
||||
[[nodiscard]] std::uint32_t
|
||||
std::uint32_t
|
||||
getSeqValue() const;
|
||||
|
||||
[[nodiscard]] AccountID
|
||||
AccountID
|
||||
getFeePayer() const;
|
||||
|
||||
[[nodiscard]] boost::container::flat_set<AccountID>
|
||||
boost::container::flat_set<AccountID>
|
||||
getMentionedAccounts() const;
|
||||
|
||||
[[nodiscard]] uint256
|
||||
uint256
|
||||
getTransactionID() const;
|
||||
|
||||
[[nodiscard]] json::Value
|
||||
json::Value
|
||||
getJson(JsonOptions options) const override;
|
||||
|
||||
[[nodiscard]] json::Value
|
||||
json::Value
|
||||
getJson(JsonOptions options, bool binary) const;
|
||||
|
||||
void
|
||||
@@ -108,27 +108,27 @@ public:
|
||||
@param rules The current ledger rules.
|
||||
@return `true` if valid signature. If invalid, the error message string.
|
||||
*/
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkSign(Rules const& rules) const;
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkBatchSign(Rules const& rules) const;
|
||||
|
||||
// SQL Functions with metadata.
|
||||
static std::string const&
|
||||
getMetaSQLInsertReplaceHeader();
|
||||
|
||||
[[nodiscard]] std::string
|
||||
std::string
|
||||
getMetaSQL(std::uint32_t inLedger, std::string const& escapedMetaData) const;
|
||||
|
||||
[[nodiscard]] std::string
|
||||
std::string
|
||||
getMetaSQL(
|
||||
Serializer rawTxn,
|
||||
std::uint32_t inLedger,
|
||||
TxnSql status,
|
||||
std::string const& escapedMetaData) const;
|
||||
|
||||
[[nodiscard]] std::vector<uint256> const&
|
||||
std::vector<uint256> const&
|
||||
getBatchTransactionIDs() const;
|
||||
|
||||
private:
|
||||
@@ -138,19 +138,19 @@ private:
|
||||
Will be *this more often than not.
|
||||
@return `true` if valid signature. If invalid, the error message string.
|
||||
*/
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkSign(Rules const& rules, STObject const& sigObject) const;
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkSingleSign(STObject const& sigObject) const;
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkMultiSign(Rules const& rules, STObject const& sigObject) const;
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkBatchSingleSign(STObject const& batchSigner) const;
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
checkBatchMultiSign(STObject const& batchSigner, Rules const& rules) const;
|
||||
|
||||
STBase*
|
||||
|
||||
@@ -36,7 +36,7 @@ class STValidation final : public STObject, public CountedObject<STValidation>
|
||||
// that use manifests this will be derived from the master public key.
|
||||
NodeID const nodeID_;
|
||||
|
||||
NetClock::time_point seenTime_{};
|
||||
NetClock::time_point seenTime_;
|
||||
|
||||
public:
|
||||
/** Construct a STValidation from a peer from serialized data.
|
||||
@@ -72,35 +72,35 @@ public:
|
||||
F&& f);
|
||||
|
||||
// Hash of the validated ledger
|
||||
[[nodiscard]] uint256
|
||||
uint256
|
||||
getLedgerHash() const;
|
||||
|
||||
// Hash of consensus transaction set used to generate ledger
|
||||
[[nodiscard]] uint256
|
||||
uint256
|
||||
getConsensusHash() const;
|
||||
|
||||
[[nodiscard]] NetClock::time_point
|
||||
NetClock::time_point
|
||||
getSignTime() const;
|
||||
|
||||
[[nodiscard]] NetClock::time_point
|
||||
NetClock::time_point
|
||||
getSeenTime() const noexcept;
|
||||
|
||||
[[nodiscard]] PublicKey const&
|
||||
PublicKey const&
|
||||
getSignerPublic() const noexcept;
|
||||
|
||||
[[nodiscard]] NodeID const&
|
||||
NodeID const&
|
||||
getNodeID() const noexcept;
|
||||
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
isValid() const noexcept;
|
||||
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
isFull() const noexcept;
|
||||
|
||||
[[nodiscard]] bool
|
||||
bool
|
||||
isTrusted() const noexcept;
|
||||
|
||||
[[nodiscard]] uint256
|
||||
uint256
|
||||
getSigningHash() const;
|
||||
|
||||
void
|
||||
@@ -112,13 +112,13 @@ public:
|
||||
void
|
||||
setSeen(NetClock::time_point s);
|
||||
|
||||
[[nodiscard]] Blob
|
||||
Blob
|
||||
getSerialized() const;
|
||||
|
||||
[[nodiscard]] Blob
|
||||
Blob
|
||||
getSignature() const;
|
||||
|
||||
[[nodiscard]] std::string
|
||||
std::string
|
||||
render() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace xrpl {
|
||||
|
||||
class STVector256 : public STBase, public CountedObject<STVector256>
|
||||
{
|
||||
std::vector<uint256> value_{};
|
||||
std::vector<uint256> value_;
|
||||
|
||||
public:
|
||||
using value_type = std::vector<uint256> const&;
|
||||
|
||||
@@ -21,7 +21,7 @@ class Serializer
|
||||
{
|
||||
private:
|
||||
// DEPRECATED
|
||||
Blob data_{};
|
||||
Blob data_;
|
||||
|
||||
public:
|
||||
explicit Serializer(int n = 256)
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
|
||||
int
|
||||
addFieldID(int type, int name);
|
||||
static int
|
||||
int
|
||||
addFieldID(SerializedTypeID type, int name)
|
||||
{
|
||||
return addFieldID(safeCast<int>(type), name);
|
||||
@@ -372,25 +372,25 @@ public:
|
||||
BaseUInt<Bits, Tag>
|
||||
getBitString();
|
||||
|
||||
static uint128
|
||||
uint128
|
||||
get128()
|
||||
{
|
||||
return getBitString<128>();
|
||||
}
|
||||
|
||||
static uint160
|
||||
uint160
|
||||
get160()
|
||||
{
|
||||
return getBitString<160>();
|
||||
}
|
||||
|
||||
static uint192
|
||||
uint192
|
||||
get192()
|
||||
{
|
||||
return getBitString<192>();
|
||||
}
|
||||
|
||||
static uint256
|
||||
uint256
|
||||
get256()
|
||||
{
|
||||
return getBitString<256>();
|
||||
|
||||
@@ -358,7 +358,7 @@ private:
|
||||
// allocated and processing time. This number is much larger than the actual
|
||||
// number of attestation a server would ever expect.
|
||||
static constexpr std::uint32_t kMaxAttestations = 256;
|
||||
AttCollection attestations_{};
|
||||
AttCollection attestations_;
|
||||
|
||||
protected:
|
||||
// Prevent slicing to the base class
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
operator result_type() noexcept
|
||||
{
|
||||
auto const d0 = sha256_hasher::result_type(h_);
|
||||
ripemd160_hasher const rh;
|
||||
ripemd160_hasher rh;
|
||||
rh(d0.data(), d0.size());
|
||||
return ripemd160_hasher::result_type(rh);
|
||||
}
|
||||
|
||||
@@ -112,9 +112,9 @@ getOrThrow(json::Value const& v, xrpl::SField const& field)
|
||||
{
|
||||
auto const s = inner.asString();
|
||||
// parse as hex
|
||||
std::uint64_t const val = 0;
|
||||
std::uint64_t val = 0;
|
||||
|
||||
auto [p, ec] = std::from_chars(s.data(), s.data() + s.size(), val != 0u, 16);
|
||||
auto [p, ec] = std::from_chars(s.data(), s.data() + s.size(), val, 16);
|
||||
|
||||
if (ec != std::errc() || (p != s.data() + s.size()))
|
||||
Throw<JsonTypeMismatchError>(key, "uint64");
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
|
||||
struct AccountTxResult
|
||||
{
|
||||
std::variant<AccountTxs, MetaTxsList> transactions{};
|
||||
std::variant<AccountTxs, MetaTxsList> transactions;
|
||||
LedgerRange ledgerRange{};
|
||||
uint32_t limit = 0;
|
||||
std::optional<AccountTxMarker> marker;
|
||||
|
||||
@@ -93,7 +93,7 @@ convert(std::string const& from, soci::blob& to);
|
||||
class Checkpointer : public std::enable_shared_from_this<Checkpointer>
|
||||
{
|
||||
public:
|
||||
[[nodiscard]] virtual std::uintptr_t
|
||||
virtual std::uintptr_t
|
||||
id() const = 0;
|
||||
virtual ~Checkpointer() = default;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ struct Gossip
|
||||
beast::IP::Endpoint address;
|
||||
};
|
||||
|
||||
std::vector<Item> items{};
|
||||
std::vector<Item> items;
|
||||
};
|
||||
|
||||
} // namespace xrpl::Resource
|
||||
|
||||
@@ -239,10 +239,10 @@ private:
|
||||
std::shared_mutex mutable mutex_;
|
||||
|
||||
/** Active manifests stored by master public key. */
|
||||
hash_map<PublicKey, Manifest> map_{};
|
||||
hash_map<PublicKey, Manifest> map_;
|
||||
|
||||
/** Master public keys stored by current ephemeral public key. */
|
||||
hash_map<PublicKey, PublicKey> signingToMasterKeys_{};
|
||||
hash_map<PublicKey, PublicKey> signingToMasterKeys_;
|
||||
|
||||
std::atomic<std::uint32_t> seq_{0};
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ struct Port
|
||||
std::string name;
|
||||
boost::asio::ip::address ip;
|
||||
std::uint16_t port = 0;
|
||||
std::set<std::string, boost::beast::iless> protocol{};
|
||||
std::vector<boost::asio::ip::network_v4> adminNetsV4{};
|
||||
std::vector<boost::asio::ip::network_v6> adminNetsV6{};
|
||||
std::vector<boost::asio::ip::network_v4> secureGatewayNetsV4{};
|
||||
std::vector<boost::asio::ip::network_v6> secureGatewayNetsV6{};
|
||||
std::set<std::string, boost::beast::iless> protocol;
|
||||
std::vector<boost::asio::ip::network_v4> adminNetsV4;
|
||||
std::vector<boost::asio::ip::network_v6> adminNetsV6;
|
||||
std::vector<boost::asio::ip::network_v4> secureGatewayNetsV4;
|
||||
std::vector<boost::asio::ip::network_v6> secureGatewayNetsV6;
|
||||
std::string user;
|
||||
std::string password;
|
||||
std::string adminUser;
|
||||
@@ -77,7 +77,7 @@ struct ParsedPort
|
||||
explicit ParsedPort() = default;
|
||||
|
||||
std::string name;
|
||||
std::set<std::string, boost::beast::iless> protocol{};
|
||||
std::set<std::string, boost::beast::iless> protocol;
|
||||
std::string user;
|
||||
std::string password;
|
||||
std::string adminUser;
|
||||
@@ -92,10 +92,10 @@ struct ParsedPort
|
||||
|
||||
std::optional<boost::asio::ip::address> ip;
|
||||
std::optional<std::uint16_t> port;
|
||||
std::vector<boost::asio::ip::network_v4> adminNetsV4{};
|
||||
std::vector<boost::asio::ip::network_v6> adminNetsV6{};
|
||||
std::vector<boost::asio::ip::network_v4> secureGatewayNetsV4{};
|
||||
std::vector<boost::asio::ip::network_v6> secureGatewayNetsV6{};
|
||||
std::vector<boost::asio::ip::network_v4> adminNetsV4;
|
||||
std::vector<boost::asio::ip::network_v6> adminNetsV6;
|
||||
std::vector<boost::asio::ip::network_v4> secureGatewayNetsV4;
|
||||
std::vector<boost::asio::ip::network_v6> secureGatewayNetsV6;
|
||||
};
|
||||
|
||||
void
|
||||
|
||||
@@ -49,14 +49,14 @@ protected:
|
||||
memcpy(data.get(), ptr, len);
|
||||
}
|
||||
|
||||
std::unique_ptr<char[]> data{};
|
||||
std::unique_ptr<char[]> data;
|
||||
std::size_t bytes;
|
||||
std::size_t used{0};
|
||||
};
|
||||
|
||||
Port const& port_;
|
||||
Handler& handler_;
|
||||
boost::asio::executor_work_guard<boost::asio::executor> work_{};
|
||||
boost::asio::executor_work_guard<boost::asio::executor> work_;
|
||||
boost::asio::strand<boost::asio::executor> strand_;
|
||||
endpoint_type remoteAddress_;
|
||||
beast::Journal const journal_;
|
||||
@@ -65,9 +65,9 @@ protected:
|
||||
std::size_t nid_;
|
||||
|
||||
boost::asio::streambuf readBuf_;
|
||||
http_request_type message_{};
|
||||
std::vector<Buffer> wq_{};
|
||||
std::vector<Buffer> wq2_{};
|
||||
http_request_type message_;
|
||||
std::vector<Buffer> wq_;
|
||||
std::vector<Buffer> wq2_;
|
||||
std::mutex mutex_;
|
||||
bool graceful_ = false;
|
||||
bool complete_ = false;
|
||||
@@ -340,7 +340,7 @@ BaseHTTPPeer<Handler, Impl>::doWriter(
|
||||
bool keepAlive,
|
||||
yield_context doYield)
|
||||
{
|
||||
std::function<void(void)> const resume;
|
||||
std::function<void(void)> resume;
|
||||
{
|
||||
auto const p = impl().shared_from_this();
|
||||
resume = std::function<void(void)>([this, p, writer, keepAlive]() {
|
||||
|
||||
@@ -31,7 +31,7 @@ protected:
|
||||
beast::WrappedSink sink_;
|
||||
beast::Journal const j_;
|
||||
|
||||
boost::asio::executor_work_guard<boost::asio::executor> work_{};
|
||||
boost::asio::executor_work_guard<boost::asio::executor> work_;
|
||||
boost::asio::strand<boost::asio::executor> strand_;
|
||||
|
||||
public:
|
||||
|
||||
@@ -35,19 +35,19 @@ protected:
|
||||
private:
|
||||
friend class BasePeer<Handler, Impl>;
|
||||
|
||||
http_request_type request_{};
|
||||
http_request_type request_;
|
||||
boost::beast::multi_buffer rb_;
|
||||
boost::beast::multi_buffer wb_;
|
||||
std::list<std::shared_ptr<WSMsg>> wq_{};
|
||||
std::list<std::shared_ptr<WSMsg>> wq_;
|
||||
/// The socket has been closed, or will close after the next write
|
||||
/// finishes. Do not do any more writes, and don't try to close
|
||||
/// again.
|
||||
bool doClose_ = false;
|
||||
boost::beast::websocket::close_reason cr_;
|
||||
waitable_timer timer_{};
|
||||
waitable_timer timer_;
|
||||
bool closeOnTimer_ = false;
|
||||
bool pingActive_ = false;
|
||||
boost::beast::websocket::ping_data payload_{};
|
||||
boost::beast::websocket::ping_data payload_;
|
||||
error_code ec_;
|
||||
std::function<void(boost::beast::websocket::frame_type, boost::beast::string_view)>
|
||||
controlCallback_;
|
||||
|
||||
@@ -193,7 +193,7 @@ Door<Handler>::Detector::doDetect(boost::asio::yield_context doYield)
|
||||
{
|
||||
boost::beast::multi_buffer buf(16);
|
||||
stream_.expires_after(std::chrono::seconds(15));
|
||||
boost::system::error_code const ec;
|
||||
boost::system::error_code ec;
|
||||
bool const ssl = async_detect_ssl(stream_, buf, doYield[ec]);
|
||||
stream_.expires_never();
|
||||
if (!ec)
|
||||
@@ -222,7 +222,7 @@ template <class Handler>
|
||||
void
|
||||
Door<Handler>::reOpen()
|
||||
{
|
||||
error_code const ec;
|
||||
error_code ec;
|
||||
|
||||
if (acceptor_.is_open())
|
||||
{
|
||||
@@ -306,7 +306,7 @@ Door<Handler>::close()
|
||||
strand_, std::bind(&Door<Handler>::close, this->shared_from_this()));
|
||||
}
|
||||
backoffTimer_.cancel();
|
||||
error_code const ec;
|
||||
error_code ec;
|
||||
acceptor_.close(ec);
|
||||
}
|
||||
|
||||
@@ -343,13 +343,13 @@ Door<Handler>::doAccept(boost::asio::yield_context doYield)
|
||||
{
|
||||
JLOG(j_.warn()) << "Throttling do_accept for " << acceptDelay_.count() << "ms.";
|
||||
backoffTimer_.expires_after(acceptDelay_);
|
||||
boost::system::error_code const tec;
|
||||
boost::system::error_code tec;
|
||||
backoffTimer_.async_wait(doYield[tec]);
|
||||
acceptDelay_ = std::min(acceptDelay_ * 2, kMaxAcceptDelay);
|
||||
continue;
|
||||
}
|
||||
|
||||
error_code const ec;
|
||||
error_code ec;
|
||||
endpoint_type remoteAddress;
|
||||
stream_type stream(ioc_);
|
||||
socket_type& socket = stream.socket();
|
||||
@@ -369,7 +369,7 @@ Door<Handler>::doAccept(boost::asio::yield_context doYield)
|
||||
<< "ms.";
|
||||
|
||||
backoffTimer_.expires_after(acceptDelay_);
|
||||
boost::system::error_code const tec;
|
||||
boost::system::error_code tec;
|
||||
backoffTimer_.async_wait(doYield[tec]);
|
||||
|
||||
acceptDelay_ = std::min(acceptDelay_ * 2, kMaxAcceptDelay);
|
||||
|
||||
@@ -143,7 +143,7 @@ template <class Handler>
|
||||
void
|
||||
PlainHTTPPeer<Handler>::doClose()
|
||||
{
|
||||
boost::system::error_code const ec;
|
||||
boost::system::error_code ec;
|
||||
socket_.shutdown(socket_type::shutdown_send, ec);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class PlainWSPeer : public BaseWSPeer<Handler, PlainWSPeer<Handler>>,
|
||||
using waitable_timer = boost::asio::basic_waitable_timer<clock_type>;
|
||||
using socket_type = boost::beast::tcp_stream;
|
||||
|
||||
boost::beast::websocket::stream<socket_type> ws_{};
|
||||
boost::beast::websocket::stream<socket_type> ws_;
|
||||
|
||||
public:
|
||||
template <class Body, class Headers>
|
||||
|
||||
@@ -26,7 +26,7 @@ private:
|
||||
using yield_context = boost::asio::yield_context;
|
||||
using error_code = boost::system::error_code;
|
||||
|
||||
std::unique_ptr<stream_type> streamPtr_{};
|
||||
std::unique_ptr<stream_type> streamPtr_;
|
||||
stream_type& stream_;
|
||||
socket_type& socket_;
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ class SSLWSPeer : public BaseWSPeer<Handler, SSLWSPeer<Handler>>,
|
||||
using stream_type = boost::beast::ssl_stream<socket_type>;
|
||||
using waitable_timer = boost::asio::basic_waitable_timer<clock_type>;
|
||||
|
||||
std::unique_ptr<stream_type> streamPtr_{};
|
||||
boost::beast::websocket::stream<stream_type&> ws_{};
|
||||
std::unique_ptr<stream_type> streamPtr_;
|
||||
boost::beast::websocket::stream<stream_type&> ws_;
|
||||
|
||||
public:
|
||||
template <class Body, class Headers>
|
||||
|
||||
@@ -68,11 +68,11 @@ private:
|
||||
beast::Journal const j_;
|
||||
boost::asio::io_context& ioContext_;
|
||||
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
|
||||
std::optional<boost::asio::executor_work_guard<boost::asio::io_context::executor_type>> work_{};
|
||||
std::optional<boost::asio::executor_work_guard<boost::asio::io_context::executor_type>> work_;
|
||||
|
||||
std::mutex m_;
|
||||
std::vector<Port> ports_{};
|
||||
std::vector<std::weak_ptr<Door<Handler>>> list_{};
|
||||
std::vector<Port> ports_;
|
||||
std::vector<std::weak_ptr<Door<Handler>>> list_;
|
||||
int high_ = 0;
|
||||
std::array<std::size_t, 64> hist_{};
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
std::size_t n_ = 0;
|
||||
bool closed_ = false;
|
||||
std::condition_variable cv_;
|
||||
boost::container::flat_map<Work*, std::weak_ptr<Work>> map_{};
|
||||
boost::container::flat_map<Work*, std::weak_ptr<Work>> map_;
|
||||
std::function<void(void)> f_;
|
||||
|
||||
public:
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
void
|
||||
close(Finisher&& f);
|
||||
|
||||
static void
|
||||
void
|
||||
close()
|
||||
{
|
||||
close([] {});
|
||||
@@ -163,7 +163,7 @@ IOList::Work::destroy()
|
||||
{
|
||||
if (!ios_)
|
||||
return;
|
||||
std::function<void(void)> const f;
|
||||
std::function<void(void)> f;
|
||||
{
|
||||
std::scoped_lock const lock(ios_->m_);
|
||||
ios_->map_.erase(this);
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
CacheType cache_{};
|
||||
CacheType cache_;
|
||||
std::atomic<std::uint32_t> gen_;
|
||||
};
|
||||
|
||||
|
||||
@@ -466,8 +466,8 @@ private:
|
||||
std::uint32_t generation;
|
||||
|
||||
// nodes we have discovered to be missing
|
||||
std::vector<std::pair<SHAMapNodeID, uint256>> missingNodes{};
|
||||
std::set<SHAMapHash> missingHashes{};
|
||||
std::vector<std::pair<SHAMapNodeID, uint256>> missingNodes;
|
||||
std::set<SHAMapHash> missingHashes;
|
||||
|
||||
// nodes we are in the process of traversing
|
||||
using StackEntry = std::tuple<
|
||||
@@ -482,7 +482,7 @@ private:
|
||||
// elements will not be invalidated during the course of element
|
||||
// insertion and removal. Containers that do not offer this guarantee,
|
||||
// such as std::vector, can't be used here.
|
||||
std::stack<StackEntry, std::deque<StackEntry>> stack{};
|
||||
std::stack<StackEntry, std::deque<StackEntry>> stack;
|
||||
|
||||
// nodes we may have acquired from deferred reads
|
||||
using DeferredNode = std::tuple<
|
||||
@@ -494,11 +494,11 @@ private:
|
||||
int deferred;
|
||||
std::mutex deferLock;
|
||||
std::condition_variable deferCondVar;
|
||||
std::vector<DeferredNode> finishedReads{};
|
||||
std::vector<DeferredNode> finishedReads;
|
||||
|
||||
// nodes we need to resume after we get their children from deferred
|
||||
// reads
|
||||
std::map<SHAMapInnerNode*, SHAMapNodeID> resumes{};
|
||||
std::map<SHAMapInnerNode*, SHAMapNodeID> resumes;
|
||||
|
||||
MissingNodes(
|
||||
int max,
|
||||
@@ -584,7 +584,7 @@ public:
|
||||
using pointer = value_type const*;
|
||||
|
||||
private:
|
||||
SharedPtrNodeStack stack_{};
|
||||
SharedPtrNodeStack stack_;
|
||||
SHAMap const* map_ = nullptr;
|
||||
pointer item_ = nullptr;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class TxQ;
|
||||
|
||||
struct ApplyResult
|
||||
{
|
||||
TER ter{};
|
||||
TER ter;
|
||||
bool applied;
|
||||
std::optional<TxMeta> metadata;
|
||||
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
beast::Journal const j;
|
||||
|
||||
/// Intermediate transaction result
|
||||
NotTEC const ter{};
|
||||
NotTEC const ter;
|
||||
|
||||
/// Constructor
|
||||
template <class Context>
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
beast::Journal const j;
|
||||
|
||||
/// Intermediate transaction result
|
||||
TER const ter{};
|
||||
TER const ter;
|
||||
|
||||
/// Success flag - whether the transaction is likely to
|
||||
/// claim a fee
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace xrpl {
|
||||
class ValidBookDirectory
|
||||
{
|
||||
bool badBookDirectory_ = false;
|
||||
hash_set<uint256> rootIndexes_{};
|
||||
hash_set<uint256> rootIndexes_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -23,19 +23,19 @@ class TransfersNotFrozen
|
||||
struct BalanceChange
|
||||
{
|
||||
SLE::const_pointer const line;
|
||||
int const balanceChangeSign{};
|
||||
int const balanceChangeSign;
|
||||
};
|
||||
|
||||
struct IssuerChanges
|
||||
{
|
||||
std::vector<BalanceChange> senders{};
|
||||
std::vector<BalanceChange> receivers{};
|
||||
std::vector<BalanceChange> senders;
|
||||
std::vector<BalanceChange> receivers;
|
||||
};
|
||||
|
||||
using ByIssuer = std::map<Issue, IssuerChanges>;
|
||||
ByIssuer balanceChanges_{};
|
||||
ByIssuer balanceChanges_;
|
||||
|
||||
std::map<AccountID, SLE::const_pointer const> possibleIssuers_{};
|
||||
std::map<AccountID, SLE::const_pointer const> possibleIssuers_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -171,7 +171,7 @@ class AccountRootsDeletedClean
|
||||
// deleted, it can still be found. After is used specifically for any checks
|
||||
// that are expected as part of the deletion, such as zeroing out the
|
||||
// balance.
|
||||
std::vector<std::pair<SLE::const_pointer, SLE::const_pointer>> accountsDeleted_{};
|
||||
std::vector<std::pair<SLE::const_pointer, SLE::const_pointer>> accountsDeleted_;
|
||||
|
||||
public:
|
||||
void
|
||||
@@ -340,10 +340,10 @@ public:
|
||||
*/
|
||||
class ValidPseudoAccounts
|
||||
{
|
||||
std::vector<std::string> errors_{};
|
||||
std::vector<std::string> errors_;
|
||||
|
||||
public:
|
||||
static void
|
||||
void
|
||||
visitEntry(bool, SLE::const_ref, SLE::const_ref);
|
||||
|
||||
bool
|
||||
@@ -360,10 +360,10 @@ public:
|
||||
class NoModifiedUnmodifiableFields
|
||||
{
|
||||
// Pair is <before, after>.
|
||||
std::set<std::pair<SLE::const_pointer, SLE::const_pointer>> changedEntries_{};
|
||||
std::set<std::pair<SLE::const_pointer, SLE::const_pointer>> changedEntries_;
|
||||
|
||||
public:
|
||||
static void
|
||||
void
|
||||
visitEntry(bool, SLE::const_ref, SLE::const_ref);
|
||||
|
||||
bool
|
||||
@@ -375,7 +375,7 @@ public:
|
||||
*/
|
||||
class ValidAmounts
|
||||
{
|
||||
std::vector<std::shared_ptr<SLE const>> afterEntries_{};
|
||||
std::vector<std::shared_ptr<SLE const>> afterEntries_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -33,19 +33,19 @@ class ValidLoanBroker
|
||||
// Collect all the LoanBrokers found directly or indirectly through
|
||||
// pseudo-accounts. Key is the brokerID / index. It will be used to find the
|
||||
// LoanBroker object if brokerBefore and brokerAfter are nullptr
|
||||
std::map<uint256, BrokerInfo> brokers_{};
|
||||
std::map<uint256, BrokerInfo> brokers_;
|
||||
// Collect all the modified trust lines. Their high and low accounts will be
|
||||
// loaded to look for LoanBroker pseudo-accounts.
|
||||
std::vector<SLE::const_pointer> lines_{};
|
||||
std::vector<SLE::const_pointer> lines_;
|
||||
// Collect all the modified MPTokens. Their accounts will be loaded to look
|
||||
// for LoanBroker pseudo-accounts.
|
||||
std::vector<SLE::const_pointer> mpts_{};
|
||||
std::vector<SLE::const_pointer> mpts_;
|
||||
|
||||
static bool
|
||||
goodZeroDirectory(ReadView const& view, SLE::const_ref dir, beast::Journal const& j);
|
||||
|
||||
public:
|
||||
static void
|
||||
void
|
||||
visitEntry(bool, SLE::const_ref, SLE::const_ref);
|
||||
|
||||
bool
|
||||
|
||||
@@ -19,7 +19,7 @@ class ValidLoan
|
||||
{
|
||||
// Pair is <before, after>. After is used for most of the checks, except
|
||||
// those that check changed values.
|
||||
std::vector<std::pair<SLE::const_pointer, SLE::const_pointer>> loans_{};
|
||||
std::vector<std::pair<SLE::const_pointer, SLE::const_pointer>> loans_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -33,7 +33,7 @@ class ValidMPTIssuance
|
||||
/// MPTokens and RippleStates deleted during apply. finalize() checks each
|
||||
/// holder's AccountRoot to detect vault pseudo-account holdings deleted
|
||||
/// outside VaultDelete. All these checks are gated on fixCleanup3_2_0.
|
||||
std::vector<std::shared_ptr<SLE const>> deletedHoldings_{};
|
||||
std::vector<std::shared_ptr<SLE const>> deletedHoldings_;
|
||||
|
||||
public:
|
||||
void
|
||||
@@ -61,7 +61,7 @@ class ValidMPTPayment
|
||||
// true if OutstandingAmount > MaximumAmount in after for any MPT
|
||||
bool overflow_{false};
|
||||
// mptid:MPTData
|
||||
hash_map<uint192, MPTData> data_{};
|
||||
hash_map<uint192, MPTData> data_;
|
||||
|
||||
public:
|
||||
void
|
||||
@@ -79,10 +79,10 @@ class ValidMPTTransfer
|
||||
std::optional<std::uint64_t> amtAfter;
|
||||
};
|
||||
// MPTID: {holder: Value}
|
||||
hash_map<uint192, hash_map<AccountID, Value>> amount_{};
|
||||
hash_map<uint192, hash_map<AccountID, Value>> amount_;
|
||||
// Deleted MPToken
|
||||
// MPToken key: true if MPTAuthorized is set
|
||||
hash_map<uint256, bool> deletedAuthorized_{};
|
||||
hash_map<uint256, bool> deletedAuthorized_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -14,7 +14,7 @@ class ValidPermissionedDEX
|
||||
bool regularOffers_ = false; // post-fixCleanup3_2_0: excludes deleted offers
|
||||
bool badHybridsOld_ = false; // pre-fixCleanup3_1_3: missing field/domain or size > 1
|
||||
bool badHybrids_ = false; // post-fixCleanup3_1_3: also catches size == 0 (size != 1)
|
||||
hash_set<uint256> domains_{};
|
||||
hash_set<uint256> domains_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -28,7 +28,7 @@ class ValidPermissionedDomain
|
||||
bool isUnique = false;
|
||||
bool isDelete = false;
|
||||
};
|
||||
std::vector<SleStatus> sleStatus_{};
|
||||
std::vector<SleStatus> sleStatus_;
|
||||
|
||||
public:
|
||||
void
|
||||
|
||||
@@ -75,11 +75,11 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
std::vector<Vault> afterVault_{};
|
||||
std::vector<Shares> afterMPTs_{};
|
||||
std::vector<Vault> beforeVault_{};
|
||||
std::vector<Shares> beforeMPTs_{};
|
||||
std::unordered_map<uint256, DeltaInfo> deltas_{};
|
||||
std::vector<Vault> afterVault_;
|
||||
std::vector<Shares> afterMPTs_;
|
||||
std::vector<Vault> beforeVault_;
|
||||
std::vector<Shares> beforeMPTs_;
|
||||
std::unordered_map<uint256, DeltaInfo> deltas_;
|
||||
|
||||
/**
|
||||
* @brief Compute the minimum STAmount scale for rounding invariant
|
||||
@@ -93,8 +93,8 @@ private:
|
||||
* @param rules Active ledger rules (used to check the amendment).
|
||||
* @returns The minimum scale to apply when rounding vault-related amounts.
|
||||
*/
|
||||
static [[nodiscard]] std::int32_t
|
||||
computeVaultMinScale(DeltaInfo const& vaultDelta, Rules const& rules);
|
||||
[[nodiscard]] std::int32_t
|
||||
computeVaultMinScale(DeltaInfo const& vaultDelta, Rules const& rules) const;
|
||||
|
||||
/**
|
||||
* @brief Return the vault-asset balance-change delta for an account.
|
||||
@@ -106,8 +106,8 @@ private:
|
||||
* @param id Account whose asset delta is requested.
|
||||
* @returns The delta, or @c std::nullopt if the entry was not touched.
|
||||
*/
|
||||
static [[nodiscard]] std::optional<DeltaInfo>
|
||||
deltaAssets(AccountID const& id);
|
||||
[[nodiscard]] std::optional<DeltaInfo>
|
||||
deltaAssets(AccountID const& id) const;
|
||||
|
||||
/**
|
||||
* @brief Return the vault-asset delta for the transaction's sending
|
||||
@@ -122,8 +122,8 @@ private:
|
||||
* @returns The fee-adjusted delta, or @c std::nullopt if the net delta is
|
||||
* zero or the account entry was not touched.
|
||||
*/
|
||||
static [[nodiscard]] std::optional<DeltaInfo>
|
||||
deltaAssetsTxAccount(STTx const& tx, XRPAmount fee);
|
||||
[[nodiscard]] std::optional<DeltaInfo>
|
||||
deltaAssetsTxAccount(STTx const& tx, XRPAmount fee) const;
|
||||
|
||||
/**
|
||||
* @brief Return the vault-share balance-change delta for an account.
|
||||
@@ -135,8 +135,8 @@ private:
|
||||
* @param id Account whose share delta is requested.
|
||||
* @returns The delta, or @c std::nullopt if the entry was not touched.
|
||||
*/
|
||||
static [[nodiscard]] std::optional<DeltaInfo>
|
||||
deltaShares(AccountID const& id);
|
||||
[[nodiscard]] std::optional<DeltaInfo>
|
||||
deltaShares(AccountID const& id) const;
|
||||
|
||||
/**
|
||||
* @brief Check whether a vault holds no assets.
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
[[nodiscard]] static std::int32_t
|
||||
computeCoarsestScale(std::vector<DeltaInfo> const& numbers);
|
||||
|
||||
static void
|
||||
void
|
||||
visitEntry(bool, SLE::const_ref, SLE::const_ref);
|
||||
|
||||
bool
|
||||
|
||||
@@ -300,7 +300,7 @@ using Strand = std::vector<std::unique_ptr<Step>>;
|
||||
inline std::uint32_t
|
||||
offersUsed(Strand const& strand)
|
||||
{
|
||||
std::uint32_t const r = 0;
|
||||
std::uint32_t r = 0;
|
||||
for (auto const& step : strand)
|
||||
{
|
||||
if (step)
|
||||
@@ -483,7 +483,7 @@ public:
|
||||
class FlowException : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
TER ter{};
|
||||
TER ter;
|
||||
|
||||
FlowException(TER t, std::string const& msg) : std::runtime_error(msg), ter(t)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ private:
|
||||
enum class Operation { Unknown, Set, Destroy };
|
||||
Operation do_{Operation::Unknown};
|
||||
std::uint32_t quorum_{0};
|
||||
std::vector<SignerEntries::SignerEntry> signers_{};
|
||||
std::vector<SignerEntries::SignerEntry> signers_;
|
||||
|
||||
public:
|
||||
static constexpr auto kConsequencesFactory = ConsequencesFactoryType::Blocker;
|
||||
@@ -77,8 +77,8 @@ private:
|
||||
TER
|
||||
destroySignerList();
|
||||
|
||||
static void
|
||||
writeSignersToSLE(SLE::pointer const& ledgerEntry, std::uint32_t flags);
|
||||
void
|
||||
writeSignersToSLE(SLE::pointer const& ledgerEntry, std::uint32_t flags) const;
|
||||
};
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
Reference in New Issue
Block a user