From 04832c29531af43acb708e5557775793ca0fe789 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 25 Mar 2019 22:39:31 -0400 Subject: enable multi-threaded network library --- include/hotstuff/hotstuff.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include/hotstuff') diff --git a/include/hotstuff/hotstuff.h b/include/hotstuff/hotstuff.h index 91001dc..c4b87cf 100644 --- a/include/hotstuff/hotstuff.h +++ b/include/hotstuff/hotstuff.h @@ -125,11 +125,13 @@ class BlockDeliveryContext: public promise_t { class HotStuffBase: public HotStuffCore { using BlockFetchContext = FetchContext; using CmdFetchContext = FetchContext; - using Net = PeerNetwork; friend BlockFetchContext; friend CmdFetchContext; + public: + using Net = PeerNetwork; + protected: /** the binding address in replica network */ NetAddr listen_addr; @@ -202,7 +204,7 @@ class HotStuffBase: public HotStuffCore { pacemaker_bt pmaker, EventContext ec, size_t nworker, - const Net::Config &config = Net::Config()); + const Net::Config &config); ~HotStuffBase(); @@ -266,14 +268,16 @@ class HotStuff: public HotStuffBase { NetAddr listen_addr, pacemaker_bt pmaker, EventContext ec = EventContext(), - size_t nworker = 4): + size_t nworker = 4, + const Net::Config &config = Net::Config()): HotStuffBase(blk_size, rid, new PrivKeyType(raw_privkey), listen_addr, std::move(pmaker), ec, - nworker) {} + nworker, + config) {} void add_replica(ReplicaID idx, const NetAddr &addr, const bytearray_t &pubkey_raw) { DataStream s(pubkey_raw); -- cgit v1.2.3-70-g09d2