aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-03-25 22:39:31 -0400
committerDeterminant <ted.sybil@gmail.com>2019-03-25 22:39:31 -0400
commit04832c29531af43acb708e5557775793ca0fe789 (patch)
treeec5524506fea1e0df1880728ee1e74d4dc2e4e78 /include
parent057064291e57de146328dd8f3c2a2492c4f9b7be (diff)
enable multi-threaded network library
Diffstat (limited to 'include')
-rw-r--r--include/hotstuff/hotstuff.h12
1 files changed, 8 insertions, 4 deletions
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<ENT_TYPE_BLK>;
using CmdFetchContext = FetchContext<ENT_TYPE_CMD>;
- using Net = PeerNetwork<opcode_t>;
friend BlockFetchContext;
friend CmdFetchContext;
+ public:
+ using Net = PeerNetwork<opcode_t>;
+
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);