Skip to content

Commit 9432c21

Browse files
Merge pull request #469 from thecodefactory/static-socket
tx/block service: replace internal pub-sub model for push-pull
2 parents c8eaaf0 + ff11d77 commit 9432c21

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/services/block_service.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool block_service::start()
7373
void block_service::work()
7474
{
7575
zmq::socket xpub(authenticator_, role::extended_publisher, external_);
76-
zmq::socket xsub(authenticator_, role::extended_subscriber, internal_);
76+
zmq::socket xsub(authenticator_, role::puller, internal_);
7777

7878
// Bind sockets to the service and worker endpoints.
7979
if (!started(bind(xpub, xsub)))
@@ -176,7 +176,7 @@ void block_service::publish_blocks(uint32_t fork_height,
176176
if (stopped())
177177
return;
178178

179-
zmq::socket publisher(authenticator_, role::publisher, internal_);
179+
zmq::socket publisher(authenticator_, role::pusher, internal_);
180180

181181
// Subscriptions are off the pub-sub thread so this must connect back.
182182
// This could be optimized by caching the socket as thread static.

src/services/transaction_service.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bool transaction_service::start()
7272
void transaction_service::work()
7373
{
7474
zmq::socket xpub(authenticator_, role::extended_publisher, external_);
75-
zmq::socket xsub(authenticator_, role::extended_subscriber, internal_);
75+
zmq::socket xsub(authenticator_, role::puller, internal_);
7676

7777
// Bind sockets to the service and worker endpoints.
7878
if (!started(bind(xpub, xsub)))
@@ -175,7 +175,7 @@ void transaction_service::publish_transaction(transaction_const_ptr tx)
175175
if (stopped())
176176
return;
177177

178-
zmq::socket publisher(authenticator_, role::publisher, internal_);
178+
zmq::socket publisher(authenticator_, role::pusher, internal_);
179179

180180
// Subscriptions are off the pub-sub thread so this must connect back.
181181
// This could be optimized by caching the socket as thread static.

0 commit comments

Comments
 (0)