style: Set clang-format width 100 (#2953)

This commit is contained in:
Ayaz Salikhov
2026-02-20 15:56:03 +00:00
committed by GitHub
parent 480264ff8f
commit 6ba58f42f0
575 changed files with 14315 additions and 6552 deletions

View File

@@ -87,28 +87,39 @@ TransactionFeed::sub(SubscriberSharedPtr const& subscriber)
void
TransactionFeed::sub(ripple::AccountID const& account, SubscriberSharedPtr const& subscriber)
{
auto const added = accountSignal_.connectTrackableSlot(subscriber, account, TransactionSlot(*this, subscriber));
auto const added = accountSignal_.connectTrackableSlot(
subscriber, account, TransactionSlot(*this, subscriber)
);
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed account " << account;
++subAccountCount_.get();
subscriber->onDisconnect([this, account](SubscriberPtr connection) { unsubInternal(account, connection); });
subscriber->onDisconnect([this, account](SubscriberPtr connection) {
unsubInternal(account, connection);
});
}
}
void
TransactionFeed::subProposed(SubscriberSharedPtr const& subscriber)
{
auto const added = txProposedSignal_.connectTrackableSlot(subscriber, TransactionSlot(*this, subscriber));
auto const added =
txProposedSignal_.connectTrackableSlot(subscriber, TransactionSlot(*this, subscriber));
if (added) {
subscriber->onDisconnect([this](SubscriberPtr connection) { unsubProposedInternal(connection); });
subscriber->onDisconnect([this](SubscriberPtr connection) {
unsubProposedInternal(connection);
});
}
}
void
TransactionFeed::subProposed(ripple::AccountID const& account, SubscriberSharedPtr const& subscriber)
TransactionFeed::subProposed(
ripple::AccountID const& account,
SubscriberSharedPtr const& subscriber
)
{
auto const added =
accountProposedSignal_.connectTrackableSlot(subscriber, account, TransactionSlot(*this, subscriber));
auto const added = accountProposedSignal_.connectTrackableSlot(
subscriber, account, TransactionSlot(*this, subscriber)
);
if (added) {
subscriber->onDisconnect([this, account](SubscriberPtr connection) {
unsubProposedInternal(account, connection);
@@ -119,11 +130,14 @@ TransactionFeed::subProposed(ripple::AccountID const& account, SubscriberSharedP
void
TransactionFeed::sub(ripple::Book const& book, SubscriberSharedPtr const& subscriber)
{
auto const added = bookSignal_.connectTrackableSlot(subscriber, book, TransactionSlot(*this, subscriber));
auto const added =
bookSignal_.connectTrackableSlot(subscriber, book, TransactionSlot(*this, subscriber));
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed book " << book;
++subBookCount_.get();
subscriber->onDisconnect([this, book](SubscriberPtr connection) { unsubInternal(book, connection); });
subscriber->onDisconnect([this, book](SubscriberPtr connection) {
unsubInternal(book, connection);
});
}
}
@@ -146,7 +160,10 @@ TransactionFeed::unsubProposed(SubscriberSharedPtr const& subscriber)
}
void
TransactionFeed::unsubProposed(ripple::AccountID const& account, SubscriberSharedPtr const& subscriber)
TransactionFeed::unsubProposed(
ripple::AccountID const& account,
SubscriberSharedPtr const& subscriber
)
{
unsubProposedInternal(account, subscriber.get());
}
@@ -194,7 +211,9 @@ TransactionFeed::pub(
if (account != amount.issue().account) {
auto fetchFundsSynchronous = [&]() {
data::synchronous([&](boost::asio::yield_context yield) {
ownerFunds = rpc::accountFunds(*backend, *amendmentCenter, lgrInfo.seq, amount, account, yield);
ownerFunds = rpc::accountFunds(
*backend, *amendmentCenter, lgrInfo.seq, amount, account, yield
);
});
};
data::retryOnTimeout(fetchFundsSynchronous);
@@ -224,9 +243,12 @@ TransactionFeed::pub(
auto const& metaObj = pubObj[JS(meta)];
ASSERT(metaObj.is_object(), "meta must be an obj in rippled and clio");
if (metaObj.as_object().contains("TransactionIndex") && metaObj.as_object().at("TransactionIndex").is_int64()) {
if (metaObj.as_object().contains("TransactionIndex") &&
metaObj.as_object().at("TransactionIndex").is_int64()) {
if (auto const& ctid = rpc::encodeCTID(
lgrInfo.seq, util::integralValueAs<uint16_t>(metaObj.as_object().at("TransactionIndex")), networkID
lgrInfo.seq,
util::integralValueAs<uint16_t>(metaObj.as_object().at("TransactionIndex")),
networkID
);
ctid)
pubObj[JS(ctid)] = ctid.value();
@@ -266,8 +288,9 @@ TransactionFeed::pub(
};
auto const affectedAccountsFlat = meta->getAffectedAccounts();
auto affectedAccounts =
std::unordered_set<ripple::AccountID>(affectedAccountsFlat.cbegin(), affectedAccountsFlat.cend());
auto affectedAccounts = std::unordered_set<ripple::AccountID>(
affectedAccountsFlat.cbegin(), affectedAccountsFlat.cend()
);
std::unordered_set<ripple::Book> affectedBooks;
@@ -310,20 +333,20 @@ TransactionFeed::pub(
affectedBooks = std::move(affectedBooks)]() {
notified_.clear();
signal_.emit(allVersionsMsgs);
// clear the notified set. If the same connection subscribes both transactions + proposed_transactions,
// rippled SENDS the same message twice
// clear the notified set. If the same connection subscribes both transactions +
// proposed_transactions, rippled SENDS the same message twice
notified_.clear();
txProposedSignal_.emit(allVersionsMsgs);
notified_.clear();
// check duplicate for account and proposed_account, this prevents sending the same message multiple times
// if it affects multiple accounts watched by the same connection
// check duplicate for account and proposed_account, this prevents sending the same message
// multiple times if it affects multiple accounts watched by the same connection
for (auto const& account : affectedAccounts) {
accountSignal_.emit(account, allVersionsMsgs);
accountProposedSignal_.emit(account, allVersionsMsgs);
}
notified_.clear();
// check duplicate for books, this prevents sending the same message multiple times if it affects multiple
// books watched by the same connection
// check duplicate for books, this prevents sending the same message multiple times if it
// affects multiple books watched by the same connection
for (auto const& book : affectedBooks) {
bookSignal_.emit(book, allVersionsMsgs);
}