mirror of
https://github.com/XRPLF/clio.git
synced 2026-07-30 02:20:28 +00:00
Fix bug: api version change does not affect the subscribed session (#1404)
Fix #1133
This commit is contained in:
@@ -70,29 +70,23 @@ TransactionFeed::TransactionSlot::operator()(AllVersionTransactionsType const& a
|
||||
}
|
||||
|
||||
void
|
||||
TransactionFeed::sub(SubscriberSharedPtr const& subscriber, std::uint32_t const apiVersion)
|
||||
TransactionFeed::sub(SubscriberSharedPtr const& subscriber)
|
||||
{
|
||||
auto const added = signal_.connectTrackableSlot(subscriber, TransactionSlot(*this, subscriber));
|
||||
if (added) {
|
||||
LOG(logger_.info()) << subscriber->tag() << "Subscribed transactions";
|
||||
++subAllCount_.get();
|
||||
subscriber->apiSubVersion = apiVersion;
|
||||
subscriber->onDisconnect.connect([this](SubscriberPtr connection) { unsubInternal(connection); });
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TransactionFeed::sub(
|
||||
ripple::AccountID const& account,
|
||||
SubscriberSharedPtr const& subscriber,
|
||||
std::uint32_t const apiVersion
|
||||
)
|
||||
TransactionFeed::sub(ripple::AccountID const& account, SubscriberSharedPtr const& subscriber)
|
||||
{
|
||||
auto const added = accountSignal_.connectTrackableSlot(subscriber, account, TransactionSlot(*this, subscriber));
|
||||
if (added) {
|
||||
LOG(logger_.info()) << subscriber->tag() << "Subscribed account " << account;
|
||||
++subAccountCount_.get();
|
||||
subscriber->apiSubVersion = apiVersion;
|
||||
subscriber->onDisconnect.connect([this, account](SubscriberPtr connection) {
|
||||
unsubInternal(account, connection);
|
||||
});
|
||||
@@ -100,13 +94,12 @@ TransactionFeed::sub(
|
||||
}
|
||||
|
||||
void
|
||||
TransactionFeed::sub(ripple::Book const& book, SubscriberSharedPtr const& subscriber, std::uint32_t const apiVersion)
|
||||
TransactionFeed::sub(ripple::Book const& book, SubscriberSharedPtr const& subscriber)
|
||||
{
|
||||
auto const added = bookSignal_.connectTrackableSlot(subscriber, book, TransactionSlot(*this, subscriber));
|
||||
if (added) {
|
||||
LOG(logger_.info()) << subscriber->tag() << "Subscribed book " << book;
|
||||
++subBookCount_.get();
|
||||
subscriber->apiSubVersion = apiVersion;
|
||||
subscriber->onDisconnect.connect([this, book](SubscriberPtr connection) { unsubInternal(book, connection); });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user