@@ -30,6 +30,7 @@ namespace server {
3030using namespace system ;
3131using namespace network ::rpc;
3232using namespace std ::placeholders;
33+ constexpr auto relaxed = std::memory_order_relaxed;
3334
3435BC_PUSH_WARNING (NO_THROW_IN_NOEXCEPT)
3536
@@ -71,7 +72,7 @@ void protocol_electrum::scripthash_subscribe(const hash_digest& hash,
7172 return ;
7273 }
7374
74- if (scripthash_subscriptions_ .size () >= options_.maximum_subscriptions )
75+ if (address_subscriptions_ .size () >= options_.maximum_subscriptions )
7576 {
7677 send_code (error::subscription_limit);
7778 return ;
@@ -93,9 +94,8 @@ void protocol_electrum::do_scripthash_subscribe(const hash_digest& hash,
9394 BC_ASSERT (notification_strand_.running_in_this_thread ());
9495
9596 // Subscription response is idempotent.
96- subscribed_scripthash_.store (true , std::memory_order_relaxed);
97- auto [it, inserted] = scripthash_subscriptions_.try_emplace (hash, type,
98- midstate{});
97+ subscribed_address_.store (true , relaxed);
98+ auto [it, in] = address_subscriptions_.try_emplace (hash, type, midstate{});
9999
100100 hash_digest status{};
101101 const auto ec = get_scripthash_status (status, it->second , it->first );
@@ -169,9 +169,9 @@ void protocol_electrum::do_scripthash_unsubscribe(
169169{
170170 BC_ASSERT (notification_strand_.running_in_this_thread ());
171171
172- const auto found = to_bool (scripthash_subscriptions_ .erase (hash));
173- if (is_zero (scripthash_subscriptions_ .size ()))
174- subscribed_scripthash_ .store (false , std::memory_order_relaxed );
172+ const auto found = to_bool (address_subscriptions_ .erase (hash));
173+ if (is_zero (address_subscriptions_ .size ()))
174+ subscribed_address_ .store (false , relaxed );
175175
176176 POST (complete_scripthash_unsubscribe, found);
177177}
@@ -192,7 +192,7 @@ void protocol_electrum::do_scripthash(node::header_t) NOEXCEPT
192192
193193 code ec{};
194194 hash_digest status{};
195- for (auto & [key, sub]: scripthash_subscriptions_ )
195+ for (auto & [key, sub]: address_subscriptions_ )
196196 {
197197 if ((ec = get_scripthash_status (status, sub, key)))
198198 {
@@ -227,7 +227,7 @@ void protocol_electrum::do_regressed(node::header_t) NOEXCEPT
227227{
228228 BC_ASSERT (notification_strand_.running_in_this_thread ());
229229
230- for (auto & [key, sub]: scripthash_subscriptions_ )
230+ for (auto & [key, sub]: address_subscriptions_ )
231231 {
232232 // writer.flush resets hash accumulator, sub.type remains unchanged.
233233 sub.state .writer .flush ();
0 commit comments