Skip to content

Commit 37e0582

Browse files
committed
Prevent block/tx parsing for addresses when no subscriptions.
1 parent a929c2b commit 37e0582

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/workers/notification_worker.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ bool notification_worker::handle_reorganization(const code& ec,
336336
return true;
337337
}
338338

339-
// Blockchain height is 64 bit but obelisk protocol is 32 bit.
339+
if (address_subscriber_->empty())
340+
return true;
341+
342+
// Blockchain height is size_t but obelisk protocol is 32 bit.
340343
auto fork_height32 = safe_unsigned<uint32_t>(fork_height);
341344

342345
for (const auto block: *new_blocks)
@@ -416,6 +419,9 @@ bool notification_worker::handle_transaction_pool(const code& ec,
416419
return true;
417420
}
418421

422+
if (address_subscriber_->empty())
423+
return true;
424+
419425
notify_transaction(0, null_hash, tx);
420426
return true;
421427
}

0 commit comments

Comments
 (0)