Skip to content

Commit ede5cfb

Browse files
committed
Start the explore service.
1 parent abb6317 commit ede5cfb

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

include/bitcoin/node/full_node.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ class BCN_API full_node
169169
void do_close() NOEXCEPT override;
170170

171171
private:
172+
void start_explore(const code& ec, const result_handler& handler) NOEXCEPT;
173+
172174
void do_subscribe_events(const event_notifier& handler,
173175
const event_completer& complete) NOEXCEPT;
174176
void do_notify(const code& ec, chase event_, event_value value) NOEXCEPT;

src/full_node.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace node {
3131
using namespace system;
3232
using namespace database;
3333
using namespace network;
34+
using namespace std::placeholders;
3435

3536
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
3637

@@ -116,7 +117,28 @@ void full_node::do_run(const result_handler& handler) NOEXCEPT
116117
// This will kick off lagging validations even if not current.
117118
do_notify(error::success, chase::start, height_t{});
118119

119-
net::do_run(handler);
120+
// Start services after network is running.
121+
net::do_run(std::bind(&full_node::start_explore, this, _1, handler));
122+
}
123+
124+
void full_node::start_explore(const code& ec,
125+
const result_handler& handler) NOEXCEPT
126+
{
127+
BC_ASSERT_MSG(stranded(), "strand");
128+
129+
if (ec)
130+
{
131+
handler(ec);
132+
return;
133+
}
134+
135+
if (!config().network.explore.enabled())
136+
{
137+
handler(ec);
138+
return;
139+
}
140+
141+
attach_explore_session()->start(move_copy(handler));
120142
}
121143

122144
void full_node::close() NOEXCEPT

0 commit comments

Comments
 (0)