mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
removed redundant adapter::new() constructor call
This commit is contained in:
@@ -244,8 +244,9 @@ fn main() -> Result<()> {
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
let adapter = RpcAdapter::new("wallet.db")?;
|
||||
debug!(target: "DARKFID", "main() [ADAPTER CREATED]");
|
||||
let ex2 = ex.clone();
|
||||
let adapter = RpcAdapter::new("wallet.db")?;
|
||||
|
||||
let (_, result) = Parallel::new()
|
||||
// Run four executor threads.
|
||||
|
||||
@@ -11,6 +11,7 @@ pub struct RpcAdapter {
|
||||
|
||||
impl RpcAdapter {
|
||||
pub fn new(dbname: &str) -> Result<Self> {
|
||||
debug!(target: "ADAPTER", "new() [CREATING NEW WALLET]");
|
||||
let wallet = WalletDB::new(dbname)?;
|
||||
Ok(Self { wallet })
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ pub async fn listen(
|
||||
pub async fn start(
|
||||
executor: Arc<Executor<'_>>,
|
||||
options: Arc<ClientProgramOptions>,
|
||||
_adapter: RpcAdapter,
|
||||
adapter: RpcAdapter,
|
||||
) -> Result<()> {
|
||||
let rpc = RpcInterface::new()?;
|
||||
let rpc = RpcInterface::new(adapter)?;
|
||||
let http = listen(
|
||||
executor.clone(),
|
||||
rpc.clone(),
|
||||
@@ -104,9 +104,8 @@ pub struct RpcInterface {
|
||||
}
|
||||
|
||||
impl RpcInterface {
|
||||
pub fn new() -> Result<Arc<Self>> {
|
||||
pub fn new(adapter: RpcAdapter) -> Result<Arc<Self>> {
|
||||
let (stop_send, stop_recv) = async_channel::unbounded::<()>();
|
||||
let adapter = RpcAdapter::new("wallet.db")?;
|
||||
Ok(Arc::new(Self {
|
||||
//p2p,
|
||||
started: Mutex::new(false),
|
||||
|
||||
Reference in New Issue
Block a user