mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-19 00:04:25 +01:00
Cleanup
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::util::Settings;
|
||||
use crate::{ChannelReply, ChannelRequest};
|
||||
use librumqttd::{
|
||||
async_locallink,
|
||||
@@ -11,7 +12,6 @@ use std::thread;
|
||||
use std::time::Duration;
|
||||
use tokio::sync::mpsc;
|
||||
use tokio::time::timeout;
|
||||
use toml::Value;
|
||||
|
||||
const SUB_TOPIC: &str = "sphinx-return";
|
||||
const PUB_TOPIC: &str = "sphinx";
|
||||
@@ -32,7 +32,7 @@ pub fn start_broker(
|
||||
mut receiver: mpsc::Receiver<ChannelRequest>,
|
||||
status_sender: mpsc::Sender<bool>,
|
||||
expected_client_id: &str,
|
||||
settings: &Value,
|
||||
settings: &Settings,
|
||||
) -> tokio::runtime::Runtime {
|
||||
let config = config(settings);
|
||||
let client_id = expected_client_id.to_string();
|
||||
@@ -148,7 +148,7 @@ fn metrics_to_status(metrics: ConnectionMetrics, client_connected: bool) -> Opti
|
||||
}
|
||||
}
|
||||
|
||||
fn config(settings: &Value) -> Config {
|
||||
fn config(settings: &Settings) -> Config {
|
||||
use librumqttd::rumqttlog::Config as RouterConfig;
|
||||
use librumqttd::{
|
||||
ConnectionLoginCredentials, ConnectionSettings, ConsoleSettings, ServerSettings,
|
||||
@@ -169,11 +169,7 @@ fn config(settings: &Value) -> Config {
|
||||
id.to_string(),
|
||||
ServerSettings {
|
||||
cert: None,
|
||||
listen: SocketAddrV4::new(
|
||||
Ipv4Addr::new(0, 0, 0, 0),
|
||||
settings["port"].as_integer().unwrap().try_into().unwrap(),
|
||||
)
|
||||
.into(),
|
||||
listen: SocketAddrV4::new(Ipv4Addr::new(0, 0, 0, 0), settings.port).into(),
|
||||
next_connection_delay_ms: 1,
|
||||
connections: ConnectionSettings {
|
||||
connection_timeout_ms: 5000,
|
||||
|
||||
Reference in New Issue
Block a user