Skip to content

Commit

Permalink
Remove unused sock file connection
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-tucci committed Feb 25, 2023
1 parent cdd7ba1 commit 38f53cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
13 changes: 3 additions & 10 deletions src/lws/src/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,17 +718,10 @@ namespace lws
}

}//anonymous
void scanner::sync(db::storage disk,lws::rpc::Connection connection)
void scanner::sync(db::storage disk)
{
try
{
if(!connection.daemon_connected)
{
MERROR("Daemon not connected so stop action called");
lws::scanner::stop();
}
MINFO("Starting blockchain sync with daemon");

json details;
int a =0;
std::vector<crypto::hash> blk_ids;
Expand Down Expand Up @@ -807,7 +800,7 @@ namespace lws
}
}

void scanner::run(db::storage disk, std::size_t thread_count,lws::rpc::Connection connection)
void scanner::run(db::storage disk, std::size_t thread_count)
{
thread_count = std::max(std::size_t(1), thread_count);

Expand Down Expand Up @@ -868,7 +861,7 @@ namespace lws
// client = MONERO_UNWRAP(ctx.connect());

// expect<rpc::client> synced = sync(disk.clone(), std::move(client));
sync(disk.clone(), connection);
sync(disk.clone());
// if (!synced)
// {
// if (!synced.matches(std::errc::timed_out))
Expand Down
4 changes: 2 additions & 2 deletions src/lws/src/scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ namespace lws
public:

//! Use `client` to sync blockchain data, and \return client if successful.
static void sync(db::storage disk,lws::rpc::Connection connection);
static void sync(db::storage disk);

//! Poll daemon until `stop()` is called, using `thread_count` threads.
static void run(db::storage disk, std::size_t thread_count,lws::rpc::Connection connection);
static void run(db::storage disk, std::size_t thread_count);

//! \return True if `stop()` has never been called.
static bool is_running() noexcept { return running; }
Expand Down
5 changes: 2 additions & 3 deletions src/lws/src/server_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,11 @@ namespace
std::signal(SIGINT, [] (int) { lws::scanner::stop(); });
fs::create_directories(prog.db_path);
auto disk = lws::db::storage::open(prog.db_path.c_str(), prog.create_queue_max);
lws::rpc::Connection connection = lws::rpc::connect_daemon();
lws::scanner::sync(disk.clone(),connection);
lws::scanner::sync(disk.clone());

lws::rest_server server{epee::to_span(prog.rest_servers), disk.clone(), std::move(prog.rest_config)};
// blocks until SIGINT
lws::scanner::run(std::move(disk), prog.scan_threads,connection);
lws::scanner::run(std::move(disk), prog.scan_threads);

}
} // anonymous
Expand Down

0 comments on commit 38f53cd

Please sign in to comment.